Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

--- 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.


share|improve this question

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.

share|improve this answer
Thanks for that. Is there a simple way to save all the data from the VG, delete the VG then make it again and restore that data into the new one with the correct PE size? Perhaps savevg and restorevg? – awmusic12635 Jun 28 '13 at 0:07
Got another hard drive laying around somewhere? :) – Michael Hampton Jun 28 '13 at 0:21
I have space offsite just not local. Just curious if what I suggested would work. – awmusic12635 Jun 28 '13 at 0:34
Anything that will get your data from one place to another intact will work. – Michael Hampton Jun 28 '13 at 0:35

You can use pvmove to move around the allocated physical extents on the physical volume(s). You should make any logical volumes begin and end on extent boundaries (grow with lvresize). The underlying physical volume size(s) should probably also be an exact multiple of the new extent size too (fix that with pvresize).

As mentioned in a superuser answer to a related question, you could use something like this:

pvmove --alloc anywhere /dev/sdc1:103680-221247 /dev/sdc1:0-103679

to move the extents 103680-221247 to 0-103679 on the physical volume /dev/sdc1. You might need to move segments in steps. Use pvdisplay --maps /dev/sdc1 to show what extents are allocated on the physical volume /dev/sdc1.

Note that the extent size should not affect I/O performance (on LVM2), only the performance of the LVM tools themselves and the maximum sizes of the LVM components should be affected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.