LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
14
Changing the volume group configuration
1. Run the vgmodify command with the –t option, which displays the range of values
(max_pv, max_pe, and disk size) to which the volume group can be tuned. For example:
# vgmodify –t –v vg02 # Table without physical extent renumbering
(For more information, see the Physical extent renumbering (-n
option) and pvmove enhanc
ement section.)
# vgmodify –t –v –n vg02 # Table with physical extent renumbering
2. Review the output and select the new values to which the volume group has to be configured.
3. Use the –r option to check if the new values selected can be applied.
# vgmodify –r –v –e 2000 –p 150 vg02 # Note –r, review mode.
4. Perform the actual operation without the –r option, but with the –a option as follows:
# vgmodify –a –v –e 2000 –p 150 vg02 # Note –a
indicates online operation
Common Version 1.0 examples
The examples in this section are applicable for both offline and online vgmodify.
In offline mode, the vgmodify command is invoked on a deactivated volume group. If required,
vgmodify internally activates the volume group and deactivates it before completion. The messages
about the activation and the deactivation of the volume group are displayed in the output.
In online mode, the vgmodify command operates on an activated volume group. You need to
specify the –a option explicitly for online mode when changing the configuration.
Online DLE examples
The fo
llowing examples assume the volume group is already activated.
Determining the correct size for a physical volume expansion
This example assumes you have a volume group with a 300 GB disk on which you have used up all
the extents and want to add at least 150GB on this disk. That is, you want a new size of 450GB
(460800MB) or more. Follow these steps:
1. Display the current state.
# vgdisplay vg1
--- Volume groups ---
VG Name /dev/vg1
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 0
Max PV 50
Cur PV 1
Act PV 1
Max PE per PV 30000
VGDA 2
PE Size (Mbytes) 16
Total PE 19199
Alloc PE 19199
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 1.0
VG Max Size 24000000m
VG Max Extents 1500000