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

4
You can create multiple snapshots using lvsplit, but they do not contain any information
required to associate the split logical volumes with the original logical volume. For snapshots, the
association with the original logical volume is maintained. Also, the snapshot creation time is very
useful in determining the point-in-time property of the snapshots.
You can atomically split multiple mirrored logical volumes using lvsplit, but you can create a
snapshot of only one logical volume at a point in time.
Snapshot tree
You can create only a single snapshot at one time, but can create multiple snapshots of a single
logical volume over a period of time. You can also only create a snapshot off an original logical
volume, but not off another snapshot logical volume. The original logical volume and all its snapshot
logical volumes are together referred to as a snapshot tree.
Each logical volume on the snapshot tree maintains a successor and predecessor relationship with the
snapshots before and after it is on the tree. When you create a snapshot off an original logical
volume, the original logical volume is the successor of the snapshot logical volume and the snapshot is
the predecessor of the original volume on the snapshot tree. For example, if you have an original
logical volume LV with snapshot S0, S0 is the predecessor of LV and LV is the successor of S0.
When the next snapshot S1 is created, S1 becomes the predecessor of LV and successor of S0. LV
becomes the successor of S1and S0 becomes the predecessor of S1. The following diagram
represents this successor-predecessor relationship of snapshots.
Figure 1: Snapshot tree
LV S1 S0
In this tree representation of snapshots, every snapshot shares data only with its successor. When a
write I/O comes to the snapshot, only this snapshot and its predecessor get a copy of the data. When
a write I/O comes to the original logical volume, only its predecessor gets a copy of the data (see the
following section).
Without this tree relationship, every snapshot directly shares data with the
original logical
volume and any
write I/O on the original logical volume requires each of its snapshots
to have its own copy
of the data
being modified. The tree representation uses the space in the
volume group more efficiently.
Data unsharing on snapshot logical volumes
By definition, a snapshot shares all of its data with the original logical volume, until an attempt is
made to change the data on either of them. At this point, data is first copied over from the original
logical volume to the snapshot in order to maintain its point-in-time characteristic of the snapshot. This
copying over of the original data is referred to as data unsharing.
To support snapshots, a new configuration parameter called the unshare unit is introduced for Version
2.2 volume groups. It is the smallest unit for which data can be unshared between a logical volume
and its snapshots. You configure the unshare unit only during creation of a volume group. The
supported values are 512 KB, 1024 KB, 2048 KB, and 4096 KB. For more information,
see vgcreate(1M).