How to increase Free PE in LVM physical volume?

mspanc asked:

I use Proxmox 2.2 for making OpenVZ containers.

It ships with a tool called vzdump that can create backups of OpenVZ containers on the fly. It uses snapshot functionality of LVM to create temporary “fork” of filesystem for backup purposes.

Unfortunately it sometimes crashes with one container that performs a lot of disk operations. As far as I know most probably it is because LVM has limited space that it can use for storing changes made to the volume during snapshot.

I’ve tried to increase snapshot size in /etc/vzdump.conf, but then vzdump returns error like

Volume group "pve" has insufficient free space (256 extents): 512 required.

When I type pvdisplay, I got:

me@srv:~# pvdisplay 
--- Physical volume ---
PV Name               /dev/md2
VG Name               pve
PV Size               921.01 GiB / not usable 3.94 MiB
Allocatable           yes 
PE Size               4.00 MiB
Total PE              235777
Free PE               256
Allocated PE          235521
PV UUID               7w2TSL-Xv76-jkDg-GrfU-AZ0g-dGq4-GLCFoA

Indeed, Free PE value is not too big

How to increase it? Is it possible without stopping services on the server?

My answer:

You can do one, or both, of two things:

  1. Reduce the amount of space in use by shrinking or removing logical volumes in the volume group.

  2. Add more space to the volume group by adding another physical volume, such as another disk array.

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.