调整前先用 tar cf /disk/home.tar /home 进行打包备份。
1、查看磁盘分区情况
fdisk -l
Disk /dev/sda: 291.9 GB, 291999055872 bytes
255 heads, 63 sectors/track, 35500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
磁盘大小,块大小,柱面情况
255 heads, 63 sectors/track, 35500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
磁盘大小,块大小,柱面情况
[root@localhost ~]# df -B 4k
Filesystem 4K-blocks Used Available Use% Mounted on
/dev/sda2 990087 500195 438786 54% /
/dev/sda5 3575306 41828 3348932 2% /home
/dev/sda1 11659 2638 8419 24% /boot
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.8G 2.0G 1.7G 54% /
/dev/sda5 14G 164M 13G 2% /home
/dev/sda1 46M 11M 33M 24% /boot
tmpfs 264M 0 264M 0% /dev/shm</
Filesystem 4K-blocks Used Available Use% Mounted on
/dev/sda2 990087 500195 438786 54% /
/dev/sda5 3575306 41828 3348932 2% /home
/dev/sda1 11659 2638 8419 24% /boot
tmpfs 67424 0 67424 0% /dev/shm
df –B 4k 以4k为以单位查看,方便计算后面分区修改后的大小
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.8G 2.0G 1.7G 54% /
/dev/sda5 14G 164M 13G 2% /home
/dev/sda1 46M 11M 33M 24% /boot
tmpfs 264M 0 264M 0% /dev/shm</