arch linux获得root,Arch Linux raspberrypi 安装后扩展root分区

Arch Linux 3.6.11-14-ARCH+ (ttyAMA0)

alarmpi login: root

鳳assword:

Last login: Thu Jan  1 00:00:18 on

ttyAMA0

[root@alarmpi ~]# ls

[root@alarmpi ~]# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.23.1).

Changes will remain in memory only, until you decide to write

them.

Be careful before using the write command.

Command (m for help): p

Disk /dev/mmcblk0: 7969 MB, 7969177600 bytes, 15564800

sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00057540

Device Boot  Start  End

Blocks

Id  System

/dev/mmcblk0p1  2048  186367  92160  c

W95 FAT32 (LBA)//这里是引导区,不变

/dev/mmcblk0p2  186368

3667967  1740800  5

Extended  //扩展分区需要重建

/dev/mmcblk0p5  188416

3667967  1739776  83

Linux  //逻辑分区需要重建

Command (m for help): d

Partition number (1,2,5, default 5): //直接回车,取默认 5,顺序要保证是先5,后2

Partition 5 is deleted

Command (m for help): p

Disk /dev/mmcblk0: 7969 MB, 7969177600 bytes, 15564800

sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00057540

Device Boot  Start  End

Blocks

Id  System

/dev/mmcblk0p1  2048  186367  92160  c

W95 FAT32 (LBA)

/dev/mmcblk0p2  186368

3667967  1740800  5

Extended

Command (m for help): d

Partition number (1,2, default

2): //直接回车,取默认

2

Partition 2 is deleted

Command (m for help): p

Disk /dev/mmcblk0: 7969 MB, 7969177600 bytes, 15564800

sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00057540

Device Boot  Start  End

Blocks

Id  System

/dev/mmcblk0p1  2048  186367  92160  c

W95 FAT32 (LBA)

Command (m for help): n

Partition type:

p  primary (1 primary, 0 extended, 3 free)

e  extended

Select (default p): e//建扩展分区

Partition number (2-4, default 2):

First sector (186368-15564799, default

186368):

Using default value 186368

Last sector, +sectors or +size{K,M,G} (186368-15564799,

default 15564799):

Using default value 15564799

Partition 2 of type Extended and of size 7.3 GiB is set

Command (m for help): p

Disk /dev/mmcblk0: 7969 MB, 7969177600 bytes, 15564800

sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00057540

Device Boot  Start  End

Blocks

Id  System

/dev/mmcblk0p1  2048  186367  92160  c

W95 FAT32 (LBA)

/dev/mmcblk0p2  186368

15564799  7689216  5

Extended

Command (m for help): n

Partition type:

p  primary (1 primary, 1 extended, 2 free)

l  logical (numbered from 5)

Select (default p): l//建逻辑分区

Adding logical partition 5

First sector (188416-15564799, default

188416):

Using default value 188416

Last sector, +sectors or +size{K,M,G} (188416-15564799,

default 15564799):

Using default value 15564799

Partition 5 of type Linux and of size 7.3 GiB is set

Command (m for help): p

Disk /dev/mmcblk0: 7969 MB, 7969177600 bytes, 15564800

sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00057540

Device Boot  Start  End

Blocks

Id  System

/dev/mmcblk0p1  2048  186367  92160  c

W95 FAT32 (LBA)

/dev/mmcblk0p2  186368

15564799  7689216  5

Extended

/dev/mmcblk0p5  188416

15564799  7688192  83

Linux

Command (m for help): w

The partition table has been altered!

然后重启, 进入系统后执行

ln -s /dev/mmcblk0p5

/dev/root

resize2fs /dev/root

结果:

[root@alarmpi ~]# df -h

Filesystem  Size  Used Avail Use% Mounted

on

/dev/root  7.3G  446M

6.5G  7% /

devtmpfs  83M  0  83M  0%

/dev

tmpfs  231M  0  231M  0%

/dev/shm

tmpfs  231M  248K

231M  1% /run

tmpfs  231M  0  231M  0%

/sys/fs/cgroup

tmpfs  231M  0  231M  0%

/tmp

/dev/mmcblk0p1  90M  24M

67M  27% /boot

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值