HP-UX System Administrator's Guide: Logical Volume Management (762803-001, March 2014)
# vgexport -v -s -m /tmp/vg_planning.map /dev/vg_planning
The vgexport command removes the volume group from the system and creates the /tmp/
vg_planning.map file.
5. Connect the disks to the new system and copy the /tmp/vg_planning.map file to the new
system.
6. If you are using an HP-UX release before March 2008, create the volume group device file
using the procedure in “Creating the Volume Group Device File” (page 47).
7. To get device file information about the disks, run the ioscan command:
# ioscan -funN -C disk
8. To preview the import operation, run the vgimport command with the -p option:
# vgimport -p -N -v -s -m /tmp/vg_planning.map /dev/vg_planning
9. To import the volume group, run vgimport without the -p option as follows:
# vgimport -N -v -s -m /tmp/vg_planning.map /dev/vg_planning
10. Activate the newly imported volume group as follows:
# vgchange -a y /dev/vg_planning
3.4.3 Moving Data to a Different Physical Volume
You can use the pvmove command to move data contained in logical volumes from one disk to
another disk or to move data between disks within a volume group.
For example, you can move the data from a specific logical volume from one disk to another, to
use the vacated space on the first disk for another purpose. To move the data in logical volume
/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.
3.4.3.1 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:
76 Administering LVM