When Good Disks Go Bad: Dealing with Disk Failures Under LVM (5900-3153, June 2013)

63
Appendix H: Disk Relocation and Recovery Using vgexport
and vgimport
Follow these steps to move a volume group /disks from one system (for example, A) to another
system (for example, B):
1. Unmount all of the mounted lvols within the volume group, vgtest, that you are exporting, and
close all of the logical volumes:
# umount /dev/vgtest/lvolX /mount_point_name (repeat for all lvols)
2. To deactivate the volume group vgtest, enter:
# vgchange -a n /dev/vgtest
3. To check the group file minor number and all lvols, enter:
# cd /dev/vgtest
# ll
4. To export the volume group LVM info to the map file, enter:
# vgexport -v -m /tmp/vgtest_map /dev/vgtest
5. Enter the following commands on system B to create the volume group director /dev/vgtest
and the character special file group:
# mkdir /dev/vgtest
# mknod /dev/vgtest/group c 64 0xXX0000
(XX = volume group minor number, should be unique on System B)
6. Import the LVM volume group vgtest onto the system:
# vgimport -v -m /tmp/vgtest_map /dev/vgtest <import_pv1>
<import_pv2> …
Notes:
1. During the vgimport action, the order of physical volumes listed in the /etc/lvmtab file
depends on the order in which the physical volumes are presented on the vgimport command
line. Whenever a bootable volume group is imported, the boot information present in the boot
disks might be incorrect due to the change in the order of imported disks in the /etc/lvmtab
file. This is because the boot information on the boot disks assumes a certain order of disks in
/etc/lvmtab and requires a resynchronization of this information after the first activation of a
newly imported bootable volume group. To resynchronize the information on the boot disk after
the first activation of a newly imported bootable volume group, enter the lvlnboot command in
recovery mode (-R option).
2. Starting with HP-UX 11i v3, while importing a volume group for a given physical volume
belonging to the importing volume group, there exists a persistent device special file (and the
legacy device special files provided the legacy mode is not disabled using the rmsf L
command).
If you choose to use the new feature introduced by the mass storage subsystem (that supports
multiple paths to a device and allows multiple paths simultaneously), follow these steps:
a. Ensure that the Mass Storage Subsystem multipath behavior is enabled using the
scsimgr command.
b. On the vgimport command line, use the persistent device special file of the physical
volumes to configure the LVM. If you need to configure legacy device files as well for
LVM configuration, you must ensure that the persistent device special file precedes the
corresponding legacy device special files on the vgimport command line. In such
cases, another alternative is to first configure the LVM with persistent device special files