LVM-Move a logical volume from one PV to another PV
LVM-Move a logical volume from one PV to another PV
example: Merge the inactive volume group named "my_vg" into the active or inactive volume group named "databases" giving verbose runtime
information
# pvmove
- pvmove allows you to move the allocated physical extents (PEs) on SourcePhysicalVolume to one or more other physical volumes (PVs). You can
optionally specify a source LogicalVolume in which case only extents used by that LV will be moved to free (or specified) extents on
DestinationPhysicalVolume(s). If no DestinationPhysicalVolume is specified, the normal allocation rules for the Volume Group are used.
Example:
Usage: pvmove -v -n [LogicalVolume] SourcePhysicalVolume DestinationPhysicalVolume
Before:
sapvmtst02:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 64G 0 disk
└─sdb1 8:17 0 9.3G 0 part
└─vg01-lvol1 254:10 0 9.3G 0 lvm /lvol1
RHCSA - v2 Page 1
Writing out final volume group after pvmove
Creating volume group backup "/etc/lvm/backup/vg01" (seqno 7).
After:
sapvmtst02:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 64G 0 disk
└─sdb1 8:17 0 9.3G 0 part
# pvremove /dev/sdb1
Labels on physical volume "/dev/sdb1" successfully wiped
RHCSA - v2 Page 2