LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)

7
For online DLE, you must use the –a and –E options to indicate that a DLE at the device side
must be handled by LVM.
DLE might require that the max_pe value is increased so that all the space can be allocated to
physical extents. This can be achieved by including the –e option and an increased max_pe
setting.
You can perform an online disk resize operation while user I/Os to the physical volumes
belonging to the volume group is question are in progress.
Before contracting a physical volume, make certain the space being reduced is not
associated with allocated extents. On HP-UX 11i v3, use the –C option to contract a physical
volume. The –C option is not available on HP-UX 11i v2.
The
vgmodify command performs a physical volume size reduction only if the space being
removed is held in extents that are free. If the extents are in use, vgmodify reports this
condition and exits without making changes. To overcome this problem, increase the physical
volume back to its original size (where possible). Then, try to reduce the size of the disk using
vgmodify from the LVM side. If you cannot increase the size of the physical volume, you
must free the extents associated with the device using pvmove, lvreduce
–k, or lvremove.
After the on-disk metadata reflects the changed configuration, the online disk resize process
updates the configuration backup file for the volume group in question to reflect the changed
configuration.
After the online or offline DLE or DLC operation completes successfully, vgmodify takes a
backup of the new volume group configuration and places it in the /etc/lvmconf directory.
After an online disk resize operation is complete, use extreme care while using older
configuration files. You must use a vgcfgrestore –vl on the files to verify that the disk
size values match the current configuration. You must manually remove the old configuration
files that hold out of date information.
If you restored an older volume group configuration on to a physical volume on which a
successful online resize operation has been completed, such a PV would not get attached
during re-activation.
Physical extent renumbering (-n option) and pvmove enhancement
A side effec
t of changing the volume group parameters is that the LVM metadata (VGRA) might
change size. The maximum size of the VGRA is limited by the physical extent size and it is replicated
on all physical volumes in the volume group. To allow the VGRA to grow to its maximum size, you
might need to make the first physical extent on each physical volume in the volume group free. This
must be accomplished outside of vgmodify by using pvmove, lvreduce, or lvremove.
An enhancement to the pvmove command enables you to move the contents of physical extent zero
thereby making it free.
A subsequent vgmodify command can reallocate an unused physical extent zero for metadata use.
A consequence of this is that physical extents are renumbered lower (the old physical extent one
becoming new physical extent zero). Logical extent numbering remains unchanged.
If the specified volume group parameters are sufficiently smaller than the existing settings, it is
possible that the new VGRA is small enough to allow metadata space to be returned to physical
extent space. When this occurs, physical extents are renumbered higher (space that was partially
metadata now holding the new physical extent zero (automatically marked free) and the old physical
extent zero becoming new physical extent one). Logical extent numbering remains unchanged.
Where a configuration permits both higher and lower renumbering (for example all physical extents
free on all physical volumes in the volume group), vgmodify favors renumbering higher.