HP-UX System Administrator's Guide: Logical Volume Management (762803-001, March 2014)

3.11.1 Types of Snapshots
Snapshots can be of two types: fully-allocated and space-efficient.
When a fully allocated snapshot is created, the number of extents required for the snapshot
is allocated immediately, just like for a normal logical volume. However, the data contained
in the original logical volume is not copied over to these extents. The copying of data occurs
through the data unsharing process.
When a space-efficient snapshot is created, the user is expected to specify the number of
extents that LVM needs to set aside to be used for unsharing in the future. These extents are
referred to as pre-allocated extents.
When an unshare operation on a snapshot can not find the required extents in the pre-allocated
extent pool, the snapshot will be marked as over-committed and inoperative. To avoid this,
after the snapshot creation, the number of pre-allocated extents may be increased using the
lvextend command with the -l or -L option. Refer to the lvcreate(1M) and lvextend(1M)
manpages for details..
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).
3.11.2 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 17) 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.
3.11.3 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:
3.11 Creating and Administering Snapshot Logical Volumes 109