LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
8
How the volume group parameter settings affect the metadata size
The choice of volume group settings is affected by the LVM metadata size. While the max_lv setting
has only a small impact on the VGRA size (by default vgcreate has already set max_lv to the
maximum possible value), the max_pv and max_pe settings are a major factor. As a general rule, if
you reduce either the max_pe or max_pv values, you can increase the other (max_pe or max_pv). As
a helpful approximation, halving one (max_pe or max_pv) allows the doubling of the other. For
example, if you halve max_pe, you can approximately double max_pv.
Configuration backup files, restore script,
and vgcfgrestore changes
The vgmodify command uses LVM configuration backup files in its operations. These backup files
are used as a source of information about the volume group, and, if needed, can be used for
recovery operations. Remember the following items:
• Each time vgmodify is used a new set of configuration backup file are created. This is done
each time to ensure it is using the most up-to-date configuration details.
• The configuration files are stored in the /etc/lvmconf directory.
• Unless being run in review (-r) or table (-t) mode, vgmodify uses vgcfgrestore to
apply the configuration to all the physical volumes. If the operation does not fully complete
(for example, it is interrupted by a system crash), you can perform a manual restoration. To
simplify a recovery, vgmodify creates a vg_name_restore script under /etc/lvmconf. The
vgmodify command does not use this shell script. It is only provided for manual restoration
to all physical volumes, taking into account any alternate paths.
With the introduction of vgmodify, the configuration files for a specific volume group might have
different parameters. The vgcfgrestore command is enhanced and now offers a –v option, which
is only applicable with –l, to additionally report from the configuration backup file the following
parameters:
• The size of each physical volume.
• The start block for physical extent zero of each physical volume.
• The PVkey (see the –k option on lvdisplay(1M)) of each physical volume (paths with the same
PVkey are links (PVlinks) to the same physical volume).
• The max_pv (maximum number of physical volumes in the volume group)
• The max_pe (maximum number of physical extents per physical volume)
• The max_lv (maximum number of logical volumes in the volume group) for the volume group.
After vgmodify has performed a modification, you must remove all old configuration backup files.
However, if some remain and a restore is to be performed, use extreme care in using older
configuration files. Issue a vgcfgrestore –vl on the file and verify the values match the current
configuration. Compare the output of vgcfgrestore –vl on the two files. If the max_pv, ma
x_pe,
or max_lv values differ, use the output of vgdisplay to validate which set is current. If the size of a
PV is different, use diskinfo on the raw device to check the current size. Manually remove old
lvmconf files that hold out of date information.
Example output:
• With the –v option:
# vgcfgrestore -vl -n vg01
Volume Group Configuration information in "/etc/lvmconf/vg01.conf"
VG Name /dev/vg01
---- Physical volumes : 2 ----
PV Type Size (kb) Start (kb) PVkey
c3t1d0 Non-Boot 1000000 1024 0
c2t1d0 Non-Boot 1000000 1024 0