LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
6
Typically, you perform these in the preceding sequence.
For offline mode, if the volume group is deactivated, it is activated by vgmodify and vgcfgbackup
called. The vgmodify command rejects starting on an active volume group if it is invoked in change
mode. This is necessary as
vgmodify must be in full control of the volume group, it must be able to
choose the options used to activate it, and have the ability to deactivate it as necessary.
For online mode, vgmodify command expects the volume group to be active.
The configuration backup file (created by
vgcfgbackup) is used to determine the volume group
layout. The current size of each physical volume is obtained by interrogating each one directly.
Changing the volume group parameters affects the size of the LVM metadata. An area at the front of
each physical volume is reserved to hold the LVM metadata. The
vgmodify command can expand the
LVM metadata if space before the first physical extent is available. It is also possible for
vgmodify to
utilize (where the -n option is used) the first physical extent, if free, for LVM metadata.
Where the options require it (change mode and changes are required),
vgmodify builds a new
configuration backup file based upon the new layout. For offline mode, the
vgmodify command then
invokes
vgcfgrestore to apply this configuration to all of the physical volumes.
Volume group configuration changes
Changing disk type (boot/non-boot) and impact of boot disks
If a non-boot volume group contains bootable physical volumes, the volume group parameters
available for selection are constrained by the boot disk. Therefore, by changing all boot disks in a
non-boot volume group to non-boot, a wider choice of settings are available. Hence run
vgmodify
with ‘
–B n’ and a trailing list of all bootable physical volumes with all the vgmodify commands
(including the
–t option) where this is the situation. Disk type can be identified by running
vgcfgrestore –l –n vg name or pvdisplay -d.
If a physical volume is incorrectly converted from bootable to non-bootable, use
vgmodify to reinstate
the type. Note that for a physical volume to be converted to a boot disk either all its extents must be
free or the first physical extent must start at block 2912 (as a user you cannot directly control the start
block for the first physical extent, conversion to boot from non-boot is normally only possible if
vgmodify was previously used to convert the same disk from boot to non-boot). Also the size of the
LVM metadata structure VGRA (Volume Group Reserve Area) can be no greater than 768 Kb. To
complete the process run
mkboot and lvlnboot to rebuild the BDRA metadata.
Dynamic LUN expansion (DLE) and dynamic LUN contraction (DLC)
When a LUN is dynamic
ally grown, use
vgmodify to enable LVM to access this new space. After the
volume group has been adjusted by
vgmodify, you can allocate the new space using the normal
LVM method by
lvextend or lvcreate.
Prior to the HP-UX 11i v3 March 2009 Update, the physical volume on which DLC is performed is
marked as unavailable from the device side. Starting with the HP-UX 11i v3 March 2009 Update, for
a DLC, you must prepare the physical volume from the LVM side (to a size smaller than the current
size) using the
vgmodify command. Then, perform a DLC operation from the device side. If you do not
prepare the physical volume for a DLC, the LUN is marked as unavailable.
Online DLE and online DLC are referred to as online disk resize operations. Use the following
guidelines:
• If
pvcreate was originally run with –s and a lower disk size value, vgmodify adjusts the
setting to match its actual size using the DLE feature.
• For offline DLE, each 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.