LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
29
# vgmodify -a -r -C 51200 vg01 /dev/rdsk/c4t2d0 #online mode
The last 4702 extent(s) on the physical volume "/dev/rdsk/c4t2d0"
have to be made free (see pvmove(1M)) to be able to prepare it for
contraction to 51200 MB.
The physical volume "/dev/rdsk/c4t2d0" can be prepared for
contraction to 56003 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 56003 MB after freeing up the last
3501 physical extents .
An update to the Volume Group IS required
Review complete. Volume group not modified
The output shows the minimum size to which the physical volume can be contracted without
having to move any physical extents on it.
3. Use the pvmove command to move the allocated extents. To reduce the size of the disk
/dev/dsk/c4t2d0 to 50 GB, out of the 14000 allocated extents, you must move the last
1201 of the allocated extents to a different disk. In other words, the total number of allocated
extents on disk /dev/dsk/c4t2d0 must be 12799.
Preview the pvmove operation.
# pvmove -p /dev/dsk/c4t2d0:12799-14000 /dev/dsk/c4t1d0
--- Preview of the Relocation Operation ---
Source PV Source PE Destination PV Destination PE
/dev/dsk/c4t2d0 12798 /dev/dsk/c4t1d0 0
/dev/dsk/c4t2d0 12799 /dev/dsk/c4t1d0 1
/dev/dsk/c4t2d0 12800 /dev/dsk/c4t1d0 2
/dev/dsk/c4t2d0 12801 /dev/dsk/c4t1d0 3
/dev/dsk/c4t2d0 12802 /dev/dsk/c4t1d0 4
* Entries deleted for brevity *
/dev/dsk/c4t2d0 13996 /dev/dsk/c4t1d0 1197
/dev/dsk/c4t2d0 13997 /dev/dsk/c4t1d0 1198
/dev/dsk/c4t2d0 13998 /dev/dsk/c4t1d0 1199
/dev/dsk/c4t2d0 13999 /dev/dsk/c4t1d0 1200
Perform the actual pvmove operation.
# pvmove /dev/dsk/c4t2d0:12799-14000 /dev/dsk/c4t1d0
Transferring logical extents of logical volume "/dev/vg01/lvol1"...
Physical volume "/dev/dsk/c4t2d0" has been successfully moved.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
4. Verify the pvmove 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 17501
Free PE 4702
Allocated PE 12799
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On
# pvdisplay /dev/dsk/c4t1d0
--- Physical volumes ---