[root@kvm10 ~]# umount /mnt/pub
vg_mntx
為例,PE 大小是 2MiB,總數有 1497 個,VG 總大小為 2MiB*1497 = 2994MiB
。
[root@kvm10 ~]# vgdisplay vg_mntx | egrep '(Size|Total)' VG Size 2.92 GiB PE Size 2.00 MiB Total PE 1497 Alloc PE / Size 36 / 72.00 MiB Free PE / Size 1461 / 2.85 GiB
vg_mntx
的 PE size 由 2M 改成 4M,但因 1497*2M 不是 4M 的倍數,所以出現以下訊息:
[root@kvm10 ~]# vgchange -s 4M vg_mntx New extent size is not a perfect fit
[root@kvm10 ~]# pvresize --help pvresize - Resize physical volume(s) pvresize PV ... [ --setphysicalvolumesize Size[m|UNIT] ] [ --reportformat basic|json ] [ COMMON_OPTIONS ]
[root@kvm10 ~]# pvresize /dev/vda3 --setphysicalvolumesize 2993m /dev/vda3: Requested size 2.92 GiB is less than real size <2.93 GiB. Proceed? [y/n]: y WARNING: /dev/vda3: Pretending size is 6129664 not 6135569 sectors. Physical volume "/dev/vda3" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized
vg_mntx
的 PE 總數改成 1496。
[root@kvm10 ~]# vgdisplay vg_mntx | egrep '(Size|Total)' VG Size 2.92 GiB PE Size 2.00 MiB Total PE 1496 Alloc PE / Size 36 / 72.00 MiB Free PE / Size 1460 / 2.85 GiB
[root@kvm10 ~]# vgchange --help vgchange - Change volume group attributes Change a general VG attribute. For options listed in parentheses, any one is required, after which the others are optional. vgchange ( -l|--logicalvolume Number, -p|--maxphysicalvolumes Number, -u|--uuid, -s|--physicalextentsize Size[m|UNIT],
[root@kvm10 ~]# vgchange -s 4M vg_mntx Volume group "vg_mntx" successfully changed
vg_mntx
的 PE Size 已改成 4M。
[root@kvm10 ~]# vgdisplay vg_mntx | egrep '(Size|Total)' VG Size 2.92 GiB PE Size 4.00 MiB Total PE 748 Alloc PE / Size 18 / 72.00 MiB Free PE / Size 730 / 2.85 GiB