# 对sda进行分区扩展 root@OpenWrt:~# sudo fdisk /dev/sda Welcome to fdisk (util-linux 2.32). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
# 输入 p 显示分区信息 Command (m for help): p Disk /dev/sda: 7.2 GiB, 7751073792 bytes, 15138816 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 Disklabel type: dos Disk identifier: 0xcbad8a62
Device Boot Start End Sectors Size Id Type /dev/sda1 * 512 33279 32768 16M 83 Linux /dev/sda2 33792 558079 524288 256M 83 Linux # 输入 d 删除 第二个分区,这里记录下第二个分区的起点是33792 Command (m for help): d Partition number (1,2, default 2):
Partition 2 has been deleted. # 输入 n 创建新的分区 Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) # 输入 p 确认是主分区 Select (default p): p # 输入分区id 用默认的2 Partition number (2-4, default 2): 2 # 输入 分区起始位置(就是原来分区2起始的位置) First sector (33280-15138815, default 34816): 33792 # 这里直接回车,默认选择终止位置就是硬盘的末尾 Last sector, +sectors or +size{K,M,G,T,P} (33792-15138815, default 15138815):
Created a new partition 2 of type 'Linux' and of size 7.2 GiB. Partition #2 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: n # 输入 w ,写入硬盘, 这里可能会有一个warning,忽略即可 Command (m for help): w
The partition table has been altered. Syncing disks.