LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)

70
Free PE 0
...
PV Name /dev/disk/disk47
PV Status available
Total PE 51133
Free PE 51133
All extents on the second PV are now free.
3. Run online vgmodify in review mode to verify if the first PV can be contracted.
# vgmodify -r -a -C 200g vg1 /dev/rdisk/disk46
vgmodify: Error: Cannot prepare physical volume "/dev/rdisk/disk46"
for contraction to the requested size 204800 MB without moving
extent(s).
The last 25600 extent(s) have to be made free (see pvmove(1M))
to be able to prepare the physical volume for contraction.
Physical volume "/dev/rdisk/disk46" was not changed.
The output indicates the first PV cannot be contracted without using the pvmove command to
move some of the extents from the logical volume from the first PV to the second PV.
4. Perform a preview of using the pvmove command to move the last 25600 extents from
disk46 to disk47.
# pvmove -p -e 25600 /dev/disk/disk46 /dev/disk/disk47
--- Preview of the Relocation Operation ---
Source PV Source PE Destination PV Destination PE
/dev/disk/disk46 25533 /dev/disk/disk47 0
/dev/disk/disk46 25534 /dev/disk/disk47 1
/dev/disk/disk46 25535 /dev/disk/disk47 2
/dev/disk/disk46 25536 /dev/disk/disk47 3
/dev/disk/disk46 25537 /dev/disk/disk47 4
...
/dev/disk/disk46 51128 /dev/disk/disk47 25595
/dev/disk/disk46 51129 /dev/disk/disk47 25596
/dev/disk/disk46 51130 /dev/disk/disk47 25597
/dev/disk/disk46 51131 /dev/disk/disk47 25598
/dev/disk/disk46 51132 /dev/disk/disk47 25599
5. Move the last 25600 extents from disk46 to disk47 using pvmove.
# pvmove -e 25600 /dev/disk/disk46 /dev/disk/disk47
Transferring logical extents of logical volume "/dev/vg1/lvol1"...
Physical volume "/dev/disk/disk46" has been successfully moved.
Volume Group configuration for /dev/vg1 has been saved in
/etc/lvmconf/vg1.conf
6. Verify the results.
# pvdisplay -v /dev/disk/disk46
--- Physical volumes ---
PV Name /dev/disk/disk46
VG Name /dev/vg1
...
PE Size (Mbytes) 8
Total PE 51133
Free PE 25600
Allocated PE 25533
...
--- Distribution of physical volume ---
LV Name LE of LV PE for LV
/dev/vg1/lvol1 25533 25533
--- Physical extents ---
PE Status LV LE