Use the following information as a guide for how to use the logical volume manager (LVM) migratepv command to migrate data that is associated with physical volumes.
You can use the LVM migratepv command to migrate data that is associated with physical volumes.
# migratepv hdisk1 hdisk2 # migratepv -l datalv hdisk3 hdisk9
In the example, all data migrates from hdisk1 to hdisk2. The migratepv command updates all LVM references. From the time that the command completes, the LVM no longer uses hdisk1 to access data that was previously stored there. As the data is physically moved, the target physical volume must have enough spare physical volumes to accommodate data from the source physical volumes. After this command completes, you can remove the source-physical volume from the volume group.
To avoid disrupting users, use the migratepv command while the system is active.
migratepv [-i] [-l LVname] SourcePV DestinationPV...
# lsvg -p rootvg rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 515 116 57..00..00..00..59 hdisk1 active 515 515 00..00..00..00..00
Now, determine the space that is currently in use on the disk that you want to migrate. This is the total physical partitions (PPs) value minus the free PPs value for the desired disk. In the preceding example, refer to hdisk0, which is using (515 - 116) PPs or 399 physical partitions.
Next, find a disk or disks that have the available space. In this case, hdisk1 has 515 free physical partitions, which is more than the required space of 399 physical partitions.
LV NAME TYPE Ps PPs PVs LV STATE MOUNT POINT hd5 boot 1 1 1 closed/syncd N/A
# lslv -l hd5 hd5:N/A PV COPIES IN BAND DISTRIBUTION hdisk0 001:000:000 100% 001:000:000:000:000
In this case, the boot image resides on the disk that you want to migrate. You must first move the boot image with the migratepv -l command.