Increase the capacity of an LVM volume group
|Debian (Lenny, Squeeze)|
|Ubuntu (Hardy, Interpid, Jaunty, Karmic, Lucid, Maverick, Natty, Oneiric, Precise)|
To increase the capacity of an existing LVM volume group by adding more physical volumes
/dev/vg0 is a volume group composed of three 100GB physical volumes, giving it a total capacity of 300GB. You wish to add two further physical volumes to increase the total capacity to 500GB.
The existing physical volumes are named
/dev/sdc. The new ones are named
With older versions of LVM it was necessary for physical volumes to be explicitly initialised using
pvcreate before being added to a volume group. As of version 2.02.54 this is no longer necessary because initialisation will occur automatically if required. Prior initialisation may still be desirable in order to deviate from the default settings used by
pvcreate, obtain better diagnostics by proceeding one step at a time, or retain compatibility with older versions of LVM.
Physical volumes can be added to a volume group using the
vgextend vg0 /dev/sdd /dev/sde
The first argument is the name of the volume group to be extended. This can be written as a pathname if you prefer (
/dev/vg0). Subsequent arguments are the physical volumes to be added.
If successful you should see a response of the form:
Volume group "vg0" successfully extended
If the physical volumes have not previously been initialised using
pvcreate then there will be some additional diagnostic messages, for example:
No physical volume label read from /dev/sdd Physical volume "/dev/sdd" successfully created No physical volume label read from /dev/sde Physical volume "/dev/sde" successfully created Volume group "vg0" successfully extended
You can check the new capacity of the volume group using the
This should give a response of the form:
VG #PV #LV #SN Attr VSize VFree vg0 5 0 0 wz--n- 499.98G 499.98G
The extra capacity added to the volume group should now be available for use, either by creating new logical volumes or by expanding the size of existing ones. In the latter case, if the logical volume contains a filesystem then you will probably want to expand that too. See:
for details of some of these processes.
See Troubleshooting LVM.