LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
35
The allocated extents on physical volume /dev/dsk/c4t2d0 were moved to
/dev/dsk/c4t1d0.
5. Run vgmodify in review mode.
# vgmodify -r -C 51200 vg01 /dev/rdsk/c4t2d0
The physical volume "/dev/rdsk/c4t2d0" is ready to be prepared for
contraction to 51200 MB.
The physical volume "/dev/rdsk/c4t2d0" can be prepared for
contraction to 48003 MB without having to move any physical extents
on it.
The physical volume "/dev/rdsk/c4t2d0" can be prepared for
contraction to a minimum size of 48003 MB after freeing up the last
5501 physical extents .
An update to the Volume Group IS required
Review complete. Volume group not modified
The last 5501 physical extents are now free because there was a hole before lvol2. By
moving lvol2, you can now perform the DLC.
6. Perform the LUN contraction.
For offline vgmodify, deactivate the volume group before performing the actual operation
and run the vgmodify command without –a option.
# vgchange -a n vg01 # For offline mode only
Volume group "vg01" has been successfully changed.
# vgmodify -C 51200 vg01 /dev/rdsk/c4t2d0 #Offline mode
or
# vgmodify -a -C 51200 vg01 /dev/rdsk/c4t2d0 #Online mode
"/dev/rdsk/c4t2d0" size changed from 71687369 to 52428800kb
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
For offline vgmodify, activate the volume group.
# vgchange -a y vg01 # Offline mode only
Activated volume group
Volume group "vg01" has been successfully changed.
7. Verify the results of the DLC operation.
# pvdisplay /dev/dsk/c4t2d0
--- Physical volumes ---
PV Name /dev/dsk/c4t2d0
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 4
Total PE 12799
Free PE 799
Allocated PE 12000
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On
After the DLC operation, Total PE is reduced from 17501 to 12799.