How to change Volumegroup PE size

awmusic12635 asked:

I am trying to increase the PE size of one of my Volume groups.

I mistakenly set it as 4M to start when it should have been 32M .

When I try to change the size I get

vgchange -s 32M the_vol
New extent size is not a perfect fit

vgdisplay says:

vgdisplay
--- Volume group ---
VG Name               the_vol
System ID             
Format                lvm2
Metadata Areas        1
Metadata Sequence No  173
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                43
Open LV               41
Max PV                0
Cur PV                1
Act PV                1
VG Size               864.25 GiB
PE Size               4.00 MiB
Total PE              221247
Alloc PE / Size       103680 / 405.00 GiB
Free  PE / Size       117567 / 459.25 GiB
VG UUID               uh25Y8-TOWR-pqBj-NyPV-ca6t-ec1k-jlqm4g

Is there anything I can do to get this change to 32 without recreating it/deleting the data?

Or getting it close to 32.

Thanks

My answer:


You can only change the physical extent size of a volume group if no existing physical extents would need to be moved to complete the change. Otherwise you receive the error that you posted above.

The only other option is to recreate the volume group with the correct size.

To quote from the man page:

Once this value has been set, it is difficult to change it without recreating the volume group which would involve backing up and restoring data on any logical volumes. However, if no extents need moving for the new value to apply, it can be altered using vgchange -s.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.