Linux Root Disk Extension

df -hT

Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext4 27G 1.9G 24G 8% /

fdisk -l

Partition 2 does not end on cylinder boundary.
/dev/sda3 392 3916 28308518 83 Linux

/ 挂载分区的扇数 392 3916

卸载目录

umount /

fuser -m -v /
fuser -m -v -k /

umount /

重新分区

fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): d
Partition number (1-4): 3

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (392-5221, default 392):
Using default value 392
Last cylinder, +cylinders or +size{K,M,G} (392-5221, default 5221):
Using default value 5221

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

fdisk -l

Partition 2 does not end on cylinder boundary.
/dev/sda3 392 5221 38790930+ 83 Linux

reboot

resize2fs /dev/sda3

你可能感兴趣的:(linux)