HP-UX 11i v3 Using LVM Logical Volume Snapshots (September 2010)

26
--- Logical extents ---
LE PV1 PE1 Status 1
00000000 /dev/disk/disk15476 00000178 shared
00000001 /dev/disk/disk15476 00000179 shared
00000002 /dev/disk/disk15476 00000180 shared
.
.
.
Importing volume groups with snapshots
A snapshot logical volume in a volume group can have the default name or a user-defined name. The
name of a logical volume in a Version 2.x volume group is stored along with the LVM configuration
information on disk. When a volume group with snapshots is exported and imported without using the
map file containing logical volume names, the snapshot logical volume is created with the default
naming convention. In this case, the list of associated snapshots of the original logical volume is still
displayed using the user-defined snapshot name. This causes inconsistency in the representation of
snapshots because a subsequent lvdisplay of the snapshot using user-defined name will fail. To
retain the user-defined name of the snapshot and ensure proper representation of the snapshots,
HP recommends you use a map file during the vgexport and vgimport operation.
The following example shows a volume group with an original logical volume /dev/vg01/lvol1
and three snapshots. One snapshot has the default name /dev/vg01/lvol1_S4 and the others are
created using user-defined names /dev/vg01/snap1 and /dev/vg01/snap2. This volume group
is exported and imported without using a map file. After the vgimport operation, the snapshots with
the user-defined names are now recreated with the DSF /dev/vg01/lvol1_S2 and
/dev/vg01/lvol1_S3. The list of associated snapshots of original logical volume
/dev/vg01/lvol1 is as follows:
Associated snapshots /dev/vg01/lvol1_S4
/dev/vg01/snap2
/dev/vg01/snap1
Although the first snapshot /dev/vg01/snap1 is recreated as /dev/vg01/lvol1_S2 and the
second snapshot /dev/vg01/snap2 is recreated as /dev/vg01/lvol1_S3, in the previous
output the user-defined names are displayed. If you try to display the logical volume properties of the
snapshot using the user-defined snapshot name, the command fails with the following output:
# lvdisplay /dev/vg01/snap1
lvdisplay: Error: Couldn't stat(2) logical volume "/dev/vg01/snap1".
[Error: No such file or directory]
Usage: lvdisplay
[-F]
[-v [-k]]
LogicalVolumePath ...
The default name of a snapshot has the minor number of the snapshot logical volume. Before
exporting the volume group, if snapshot /dev/vg01/snap1 of the logical volume
/dev/vg01/lvol1 had the minor number 2, after importing the volume group without the map file,
the snapshot device special file is created as /dev/vg01/lvol1_S2. From this new device special
file name, you can interpret that its minor number is 2 and the original logical volume of the snapshot
is /dev/vg01/lvol1. Using this information and the corresponding user-defined name of the
snapshot prior to exporting the volume group, you can recreate the device special file of the snapshot
with the original user-defined name /dev/vg01/snap1.
If you did not store this information before exporting the volume group and if the volume group had
more than one snapshot with a user-defined name before exporting the volume group, you cannot
map the names of snapshot device special files to their original user-defined names. In the previous