利用parted工具擴展磁區空間
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | parted /dev/mmcblk0 (parted) print free Model: SD SMI (sd/mmc) Disk /dev/mmcblk0: 7929MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 32.3kB 1049kB 1016kB Free Space 1 1049kB 3247MB 3246MB primary ext4 3247MB 7929MB 4682MB Free Space //確認磁區號碼為1號 (parted) resizepart Partition number? 1 Warning: Partition /dev/mmcblk0p1 is being used. Are you sure you want to continue? Yes/No? yes End? [3247MB]? 7929MB Error: Error informing the kernel about modifications to partition /dev/mmcblk0p1 -- Invalid argument. This means Linux won't know about any changes you made to /dev/mmcblk0p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. Ignore/Cancel? Ignore root@ikw:~# reboot |
重新開機後 利用resize2fs 完成系統擴展
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | root@ikw:~# resize2fs /dev/mmcblk0p1 resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/mmcblk0p1 is now 1935535 (4k) blocks long. root@ikw:~# df -h Filesystem Size Used Avail Use% Mounted on udev 181M 0 181M 0% /dev tmpfs 50M 1.2M 49M 3% /run /dev/mmcblk0p1 7.3G 2.0G 5.3G 27% / tmpfs 248M 0 248M 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 248M 0 248M 0% /sys/fs/cgroup tmpfs 248M 4.0K 248M 1% /tmp /dev/zram0 49M 25M 22M 53% /var/log tmpfs 50M 0 50M 0% /run/user/0 |
即可完成 ^ ^