我试图用parted和resize2fs调整分区大小。
我尝试了以下方法:
#parted
Partition Table: msdos
Number Start End Size Type File system Flags
1 2097kB 21.0GB 21.0GB primary ext4 boot
2 21.0GB 500GB 479GB primary ext4
3 500GB 500GB 536MB primary linux-swap(v1)
(parted) rm 2
(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? ext4
Start? 41GB
End? 500GB
(parted) q
Information: You may need to update /etc/fstab.
#resize2fs /dev/sda2
resize2fs 1.42.5 (29-Jul-2012)
resize2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem …Run Code Online (Sandbox Code Playgroud)