上次我缩小分区时,就像删除它并从同一个起始扇区重新创建它一样简单。但是这一次,fdisk将不允许从扇区63重新创建分区,它至少会强制2048。
请注意,我正在使用无头服务器,并且gparted不是一个选项,因为它是一个GUI。
- 为什么这个行为来自fdisk?
- 使用2048会导致数据丢失吗?
- 缩小分区的任何变通方法或解决方案?
root@ubuntulive:~# fdisk -u=sectors /dev/sda
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 identifier: 0x0ab2afe6
Device Boot Start End Blocks Id System
/dev/sda1 * 63 104872319 52436128+ 83 Linux
/dev/sda2 104872320 113274314 4200997+ 83 Linux
/dev/sda3 113274315 312576704 99651195 83 Linux
Command (m for help): d
Partition number (1-4): 1
Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-312581807, default 2048): 63
Value out of range.
First sector (2048-312581807, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104872319, default 104872319): 52436159
Command (m for help): p
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 identifier: 0x0ab2afe6
Device Boot Start End Blocks Id System
/dev/sda1 2048 52436159 26217056 83 Linux
/dev/sda2 104872320 113274314 4200997+ 83 Linux
/dev/sda3 113274315 312576704 99651195 83 Linux