[root@kvm8 ~]# df -Th /home Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg_kvmhome-vo ext4 97M 5.6M 87M 7% /home
[root@kvm8 ~]# umount /home/
[root@kvm8 ~]# lvresize -L 50M /dev/mapper/vg_kvmhome-vo -r fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/mapper/vg_kvmhome-vo: clean, 47/20480 files, 8288/81920 blocks resize2fs 1.41.12 (17-May-2010) Resizing the filesystem on /dev/dm-2 to 51200 (1k) blocks. The filesystem on /dev/dm-2 is now 51200 blocks long. Reducing logical volume vo to 50.00 MiB Logical volume vo successfully resized
/dev/mapper/vg_kvmusb-vo
已調成 50M。
[root@kvm8 ~]# mount -a [root@kvm8 ~]# df -h /home Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_kvmhome-vo 49M 5.1M 41M 12% /home
/dev/mapper/vg_kvmusb-vo
放大成 120M,出現錯誤訊息,要求先檢查檔案系統。
[root@kvm8 ~]# umount /home/ [root@kvm8 ~]# lvresize -L 120M /dev/mapper/vg_kvmhome-vo -r fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/mapper/vg_kvmhome-vo: clean, 47/14336 files, 6998/51200 blocks Extending logical volume vo to 120.00 MiB Logical volume vo successfully resized resize2fs 1.41.12 (17-May-2010) Please run 'e2fsck -f /dev/dm-2' first. fsadm: Resize ext4 failed fsadm failed: 1
/dev/mapper/vg_kvmusb-vo
,也就是 /dev/dm-2
。
[root@kvm8 ~]# e2fsck -f /dev/dm-2 e2fsck 1.41.12 (17-May-2010) 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/dm-2: 47/14336 files (4.3% non-contiguous), 6998/51200 blocks
/dev/mapper/vg_kvmusb-vo
放大成 120M,已沒有錯誤訊息,要求先檢查檔案系統。
[root@kvm8 ~]# lvresize -L 120M /dev/mapper/vg_kvmhome-vo -r fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/mapper/vg_kvmhome-vo: clean, 47/14336 files, 6998/51200 blocks Extending logical volume vo to 120.00 MiB Logical volume vo successfully resized resize2fs 1.41.12 (17-May-2010) Resizing the filesystem on /dev/dm-2 to 122880 (1k) blocks. The filesystem on /dev/dm-2 is now 122880 blocks long.
/dev/mapper/vg_kvmusb-vo
已調成 120M。
[root@kvm8 ~]# mount -a [root@kvm8 ~]# df -h /home Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_kvmhome-vo 117M 5.6M 105M 6% /home