HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)
10. Back up the volume group configuration as follows:
# vgcfgbackup /dev/vgnn
Moving Disks Between Systems
To move the disks in a volume group to different hardware locations on a different system, export
the volume group from one system, physically move the disks to the other system, and import the
volume group there. The procedures for exporting and importing a volume are described in
“Exporting a Volume Group” (page 57) and “Importing a Volume Group” (page 57). They are
illustrated in the following example.
NOTE: If the volume group contains any multipathed disks, see the note under “Importing a
Volume Group” (page 57).
To move the three disks in the volume group /dev/vg_planning to another system, follow these
steps:
1. If any of the logical volumes contain a file system, unmount the file system. If any of the logical
volumes are used as secondary swap, disable swap and reboot the system; for information
on secondary swap, see HP-UX System Administrator's Guide: Configuration Management.
2. Make the volume group and its associated logical volumes unavailable to users as follows:
# vgchange -a n /dev/vg_planning
3. Preview the removal of the volume group information from the LVM configuration files using
the following command:
# vgexport -p -v -s -m /tmp/vg_planning.map /dev/vg_planning
With the -m option, you can specify the name of a map file that will hold the information that
is removed from the LVM configuration files. The map file contains the names of all logical
volumes in the volume group. You use this map file when you set up the volume group on the
new system.
4. If the preview is satisfactory, remove the volume group information as follows:
# 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 44).
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
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
72 Administering LVM