Beginning with the HP-UX 11i v3 September 2010 Update, LVM can be enabled to
automatically increase the pre-allocated extents of a snapshot when the threshold is reached.
With this update, space efficient snapshots' threshold value can also be configured by the
user. Administrators can use the
lvcreate
or
lvchange
command to enable automatic
increase of pre-allocated extents (via the
-e
option) and specify the threshold value (via the
-P
option). The threshold value and whether automatic pre-allocation is enabled are displayed
in the
lvdisplay
command output. When automatic increase of pre-allocated extents is
enabled, additional messages is printed to
syslog
when the threshold is reached. See these
manpages for full details: lvcreate(1M), lvchange(1M), lvdisplay(1M), and lvm(7).
Creating a Snapshot Logical Volume
LVM snapshot logical volumes are created with the
-S
option of the
lvcreate
command. For
example:
# lvcreate -S s -L 10 /dev/vg03/lvol1
where:
-S
snap_type
Specifies the creation of a snapshot logical volume with the
s
value for
snap_type
.
-L
space
Allocates space for the space-efficient snapshot logical volume, in megabytes.
Instead of the
-L
option, you can use the
-l le_number
option to allocate
space in terms of number of pre-allocated extents. The
-L
and
-l
options are
mutually exclusive. If neither the
-L
nor
-l
option is used, a fully allocated
snapshot is created.
Refer to the lvcreate(1M) manpage for more details and full syntax for creating snapshot logical
volumes. Refer to the
“Naming Conventions for LVM” (page 13)
section for naming conventions
used for snapshot logical volumes.
NOTE:
Once snapshots are created, their size and the number of mirror copies cannot be changed
using the
lvextend
or
lvreduce
commands.
Removing Snapshot Logical Volumes
Any snapshot on the snapshot tree can be deleted using the
lvremove
command. A new
lvremove
option,
-F
, has been introduced which allows the user to delete a snapshot and all its
predecessors using a single
lvremove
command.
For example, for a LV having 4 snapshots, where
/dev/vg01/lvol1_S5
is the latest one, all of
the snapshots can be deleted using the following command:
# lvremove -F /dev/vg01/lvol1_S5
Refer to the lvremove(1M) manpage for more details and full syntax for deleting logical volumes
on the snapshot tree.
Displaying Snapshot Information
The
vgdisplay
,
lvdisplay
, and
pvdisplay
commands will now display additional information
when snapshots are involved.
A summary of the additional fields displayed by these commands is listed here. See the respective
manpages and the LVM Snapshot Logical Volumes white paper for more detailed information.
The
vgdisplay
command now additionally displays the following data:
•
The number of snapshot logical volumes in the volume group.
•
The unshare unit size for the volume group.
•
The number of pre-allocated physical extents in the volume group.
104 Administering LVM