HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)

/dev/vg01/markets from the disk /dev/disk/disk4 to the disk /dev/disk/disk7, enter
the following:
# pvmove -n /dev/vg01/markets /dev/disk/disk4 /dev/disk/disk7
On the other hand, you can move all the data contained on one disk, regardless of which logical
volume it is associated with, to another disk within the same volume group. For example, do this
to remove a disk from a volume group. You can use pvmove to move the data to other specified
disks or let LVM move the data to appropriate available space within the volume group, subject
to any mirroring allocation policies.
To move all data off disk /dev/dsk/disk3 and relocate it at the destination disk /dev/disk/
disk5, enter the following command:
# pvmove /dev/disk/disk3 /dev/disk/disk5
To move all data off disk /dev/disk/disk3 and let LVM transfer the data to available space
within the volume group, enter the following command:
# pvmove /dev/disk/disk3
In each of the previous instances, if space does not exist on the destination disk, the pvmove
command fails. The pvmove also provides a-p option for you to preview the operation before
actually performing the move.
Moving a Root Disk to Another Disk
If the data to be moved is the root disk, additional steps are required. Use the following steps on
an HP 9000 system as an example, to move root disk /dev/disk/disk1 (source disk) to disk
/dev/disk/disk4 (destination disk) staying within the same volume group:
1. To make the destination disk a bootable LVM disk, enter:
# pvcreate -B /dev/rdisk/disk4
2. To make the disk bootable. Enter:
# mkboot /dev/rdisk/disk4
# mkboot -a "hpux -a (;0)/stand/vmunix" /dev/rdisk/disk4
3. To extend your root volume group with the destination disk, enter:
# vgextend /dev/vg00 /dev/disk/disk4
4. To move all physical extents from the source disk to the destination disk, enter:
# pvmove /dev/disk/disk1 /dev/disk/disk4
5. To reduce the source disk from the volume group, enter:
# vgreduce /dev/vg00 /dev/disk/disk1
6. To shut down and reboot from the new root disk in maintenance mode, enter:
ISL> hpux -lm (;0)/stand/vmunix
7. In maintenance mode, to update the BDRA and the LABEL file, enter:
# vgchange -a y /dev/vg00
# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -Rv
# vgchange -a n /dev/vg00
8. Reboot the system normally.
pvmove Command Syntax
Beginning with the September 2008 Update, pvmove provides these options:
-p Provides a preview of the move but does not actually perform the move.
-e no_of_extents Moves the last number of physical extents, specified by
no_of_extents.
Moving and Reconfiguring Your Disks 73