这是我当前的磁盘分区配置
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
├─sda1 8:1 0 200M 0 part /boot
├─sda2 8:2 0 3.9G 0 part
├─sda3 8:3 0 34.2G 0 part /
└─sda4 8:4 0 1.8G 0 part /home
sdb 8:16 0 20G 0 disk
sr0 11:0 1 1024M 0 rom
我想调整当前 上的根分区的大小
sda3
,并将其扩展到 上的可用空间sdb
。之后,我的根分区的大小将是54.2G如果此可用空间(未分配)存在于磁盘和磁盘末尾(扇区数距离太多且超出限制),谁可以为此解决问题采取其他方法。
------编辑------了解更多信息:
通过 fdisk:
# fdisk -l
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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 /dev/sda: 150 GiB, 161061273600 bytes, 314572800 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: 0x2971e5ee
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 411647 409600 200M 83 Linux
/dev/sda2 411648 8515575 8103928 3.9G 82 Linux swap / Solaris
/dev/sda3 8515584 80195583 71680000 34.2G 83 Linux
/dev/sda4 80195584 83886079 3690496 1.8G 83 Linux
通过分手:
(parted) p free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 161GB
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 211MB 210MB primary ext2 boot
2 211MB 4360MB 4149MB primary linux-swap(v1)
4360MB 4360MB 4096B Free Space
3 4360MB 41.1GB 36.7GB primary ext4
4 41.1GB 42.9GB 1890MB primary ext4
42.9GB 161GB 118GB Free Space
笔记
未分配的扇区不分别重新组合在一起