一 扩展逻辑卷
1 检查挂载信息 df -hT|grep xiaofeng
[root@linuxprobe ~]# df -hT|grep xiaofeng
/dev/mapper/sonny-xiaofeng ext4 380M 2.3M 354M 1% /root/new_disk/lv/xiaofeng
2 卸载逻辑卷 umount /dev/sonny/xiaofeng
[root@linuxprobe ~]# umount /dev/sonny/xiaofeng
3 扩展逻辑卷,扩展至800M lvextend -L 800M /dev/sonny/xiaofeng
[root@linuxprobe ~]# lvextend -L800M /dev/sonny/xiaofeng
Size of logical volume sonny/xiaofeng changed from 400.00 MiB (100 extents) to 800.00 MiB (200 extents).
Logical volume sonny/xiaofeng successfully resized.
二 同步信息
1 检查逻辑卷 e2fsck -f /dev/sonny/xiaofeng
[root@linuxprobe ~]# e2fsck -f /dev/sonny/xiaofeng
e2fsck 1.44.3 (10-July-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sonny/xiaofeng: 11/102400 files (0.0% non-contiguous), 23456/409600 blocks
2 同步信息 resize2fs /dev/sonny/xiaofeng
[root@linuxprobe ~]# resize2fs /dev/sonny/xiaofeng
resize2fs 1.44.3 (10-July-2018)
Resizing the filesystem on /dev/sonny/xiaofeng to 819200 (1k) blocks.
The filesystem on /dev/sonny/xiaofeng is now 819200 (1k) blocks long.
三 重新挂载
1 挂载逻辑卷 mount -a
[root@linuxprobe ~]# mount -a
2 检查挂载情况 df -hT|grep xiaofeng
[root@linuxprobe ~]# df -hT|grep xiaofeng
/dev/mapper/sonny-xiaofeng ext4 767M 2.5M 721M 1% /root/new_disk/lv/xiaofeng
可见容量已经扩展,大功告成!