Raspberry Pi 測試 – ArchLinux Server 篇 擴展 root 分割區

參考網站:Cubiksoundz – Technically Speaking…: Expanding Raspberry Pi SD Card Partition on Arch Linux
分割硬碟
# fdisk /dev/mmcblk0

[@more@]刪除第 2 個分割區
Command (m for help): d
Partition number (1,2,5, default 5): 2

Partition 2 has been deleted.

建立 extended 分割區
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): 2
First sector (186368-30881791, default 186368):
Last sector, +sectors or +size{K,M,G,T,P} (186368-30881791, default 30881791):

Created a new partition 2 of type ‘Extended’ and of size 14.7 GiB.

建立 logical 分割區
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-30881791, default 188416):
Last sector, +sectors or +size{K,M,G,T,P} (188416-30881791, default 30881791):

Created a new partition 5 of type ‘Linux’ and of size 14.7 GiB.

寫入並結束

重新啟動電腦
# reboot

使用 resize2fs 擴大分割區的大小
# resize2fs /dev/mmcblk0p5
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mmcblk0p5 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p5 is now 3836672 blocks long.