Dynamic LUN expansion and LUN contraction

From Wiki-UX.info
Jump to: navigation, search


This article is a quickly extract of the key information required to use vgmodify to notify the system of a DLE or DLC event on the LVM backing storage.


When a LUN is dynamically grown, vgmodify should be used to allow LVM to access this new space. Once the volume group has been adjusted by vgmodify the new space can be allocated using the normal LVM method by lvextend or lvcreate.

  • Every time vgmodify is run it automatically obtains the current disk size and compares this with the size known to LVM. No additional options are required to handle a DLE event.
  • If pvcreate was originally run with –s and a lower disk size value vgmodify adjusts the setting to match its actual size.
  • DLE may 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.
  • Before contracting a physical volume make certain the space being reduced is not associated with allocated extents.
  • 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 the physical volume should be increased back to its original size (where possible) and then the extents in use made free before again reducing the size of the disk. Where it is not possible to increase the size of the physical volume, the extents associated with the device should be made free via lvreduce –k or lvremove.