Using LVM Logical Volume Snapshots: Technical White Paper
Using LVM Logical Volume Snapshots: Technical White Paper
Using LVM Logical Volume Snapshots: Technical White Paper
Table of contents
Using LVM logical volume snapshots ...................................................................................................... 1
Abstract .............................................................................................................................................. 2
Audience ............................................................................................................................................ 2
HP-UX LVM snapshot overview .............................................................................................................. 2
Types of snapshot logical volumes ...................................................................................................... 2
Snapshot uses .................................................................................................................................. 3
Difference between snapshot logical volumes and split logical volumes .................................................. 3
Snapshot tree .................................................................................................................................. 4
Data unsharing on snapshot logical volumes ....................................................................................... 4
Creating and administering snapshots .................................................................................................... 7
Creating snapshots........................................................................................................................... 8
Extending the pre-allocated extent pool............................................................................................. 10
Enabling the automatic increase of pre-allocated extents ..................................................................... 12
Changing the Attributes of a Snapshot Logical Volume ....................................................................... 14
Changing the attributes of a logical volume having snapshots ............................................................. 16
Deleting logical volumes on a snapshot tree ...................................................................................... 16
Displaying Snapshot Information ...................................................................................................... 18
Importing volume groups with snapshots ........................................................................................... 26
Reconfiguring a volume group using vgmodify................................................................................... 27
Migration of volume group version using vgversion ............................................................................ 27
pvmove , vgmove, and lvmove commands ........................................................................................ 28
vgreduce command ........................................................................................................................ 28
lvsplit and lvmerge commands ......................................................................................................... 28
vgchange command ....................................................................................................................... 28
Configurable location for the volume group configuration file .............................................................. 29
Limitations when using snapshots ......................................................................................................... 29
Common use examples....................................................................................................................... 30
Recommended practices ..................................................................................................................... 32
Error messages .................................................................................................................................. 32
Performance numbers ......................................................................................................................... 35
Read performance.......................................................................................................................... 35
Write performance ......................................................................................................................... 36
Configuration file size ........................................................................................................................ 38
For more information .......................................................................................................................... 39
Feedback.......................................................................................................................................... 39
Abstract
Beginning with the HP-UX 11i v3 March 2010 Update release, LVM supports Version 2.2 volume
groups. This update also enables you to create snapshots of logical volumes belonging to Version 2.2
volume groups.
This white paper explains how to create and administer the snapshots, limitations when using
snapshots, and recommended practices.
Audience
The document is intended for system administrators, operators, and customers who want to create and
use snapshot logical volumes belonging to Version 2.2 volume groups. It is assumed that you have a
basic knowledge of LVM.
Fully-allocated snapshots
When a fully-allocated snapshot is created, the number of extents or the total storage capacity
required for the snapshot is allocated immediately, just like for a normal logical volume. The data
contained in the original logical volume is not copied to these extents. The copying of data happens
on an on-demand basis as and when data on the original logical volume or snapshot logical
volume changes.
Space-efficient snapshots
Unlike a fully-allocated snapshot, when a space-efficient snapshot is created, all the extents of the
snapshot are not allocated immediately. The user has to explicitly specify the number of extents that
2
LVM needs to set aside for copying over data from the original logical volume in future. These extents
are referred to as pre-allocated extents. When some data is unshared on a space-efficient snapshot,
an extent that satisfies the allocation policy of the snapshot is picked from the pool of pre-allocated
extents and data from the original logical volume is copied over to this extent. The success of a
space-efficient snapshot lies in provisioning for the right number of pre-allocated extents. For more
information, see Creating snapshots
Snapshot uses
You typically use snapshots for the following:
• Backup
Because a snapshot is created almost instantaneously, you can use it to create multiple point-in-time
images of the logical volume without having to disrupt the applications using the logical volumes.
You mount the snapshot image on a backup server and use it as a normal volume for backup
purposes. This greatly reduces the application downtime required to back up the volumes.
• Restore
If the original logical volume image is corrupted, you can use its snapshot to restore the original
logical volume back to an image represented by the snapshot. Although LVM currently does not
support instant restore, you can manually copy the snapshot contents to the original logical volume.
• Data mining
You can run data mining applications on the snapshot without affecting the performance of the
original logical volume.
• Testing of applications
You can create a snapshot of the production data and test prototype applications on the snapshot.
If the snapshot is corrupted during testing, you can delete and recreate it for further testing.
3
• 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.
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.
4
When a write comes to the original logical volume on the snapshot tree, the unshare units to which
the write is destined are unshared first. This means that the data in these unshare units are copied to
its predecessor before the write to the original logical volume proceeds. This is referred to as a copy-
before-write operation (CBW). When a write comes to a snapshot logical volume, two CBW
operations might be required.
Building on the snapshot tree depicted in Figure1, Figure 2 shows the contents of the unshare units of
each logical volume on the snapshot tree. The arrow indicates that the data in the unshare unit is
shared with its successor. The initial contents of the original logical volume LV was the same as that of
its first snapshot S0. For example, S0 and S1 initially shared all their data with the original logical
volume LV and a write comes to S1’s second unshare unit containing B. Because S1 shares data with
its successor (LV) and predecessor (S0) for this unshare unit, the original data B is copied to S1 from
LV, then to S0 from LV, and then the new data X is written to S1. At this point, S0 and S1 have the
second unshare unit completely unshared. If a subsequent write Y comes to the third unshare unit of
the original logical volume LV, the original data C is copied over from LV to S1 and then the write Y
is allowed to proceed. Only the third unshare unit of S1 is unshared; S0 still shares this data with S1.
A A A
B X B
Y C C
D D D
LV S1 S0
If a data unshare operation fails, the data contained in the snapshot logical volume no longer remains
point-in-time. Such a snapshot logical volume is marked as inoperative. After a snapshot becomes
inoperative, subsequent read and write operations on the snapshot fail. When a space-efficient
snapshot logical volume becomes inoperative, its pre-allocated extents are freed and available as free
extents in the volume group.
When a snapshot that has a file system mounted on it becomes inoperative, you cannot access the file
system contents or list the files in the file system. However, if the file system is mounted as read-only on
a snapshot logical volume (that is configured as read-write or read-only), you can access the file
system contents even after the snapshot becomes inoperative. Mounting a file system on an
inoperative snapshot fails.
For a fully-allocated snapshot, the extent to which the data is unshared is already allocated at the time
of snapshot creation. For a space-efficient snapshot, the extent is picked from the pre-allocated pool of
extents, such that the extent or the set of extents picked satisfies the allocation policy of the snapshot.
As subsequent data unsharing continues to pick extents from the pre-allocated pool, there might be an
instance when no extent can be picked from the pre-allocated pool either because all the extents in
the pool have been used up or the remaining extents in the pool do not satisfy the allocation policy of
the snapshot logical volume. In these cases, the snapshot is referred to as over-committed. It is also
5
marked as inoperative because the data unshare operation fails to complete. After a snapshot is
marked inoperative, all its predecessors that share data with this snapshot are also marked as
inoperative. A fully-allocated snapshot can never become over-committed because all snapshot extents
are allocated at the time of snapshot creation. Figure 3 shows the different snapshot states.
Operative
Failed to find an appropriate • I/O or data unshare on
extent in the pre-allocated the snapshot failed.
pool. (space-efficient • If the snapshot shares data
snapshots only) with its successor and the
successor is marked as
inoperative.
Over-commit,
Inoperative
Inoperative
Note
Contiguous allocation policy is not supported for a space-efficient snapshot.
When the number of extents in the pre-allocated pool reaches the threshold value, LVM prints the
following message in the syslog:
6
LVM: WARNING: Snapshot LV (VG 128 0x000000, LV Number: 6) threshold value
reached. Please increase the number of pre-allocated extents for this
snapshot LV
You can easily identify the snapshot logical volume by the volume group and logical volume numbers
in the message. LVM also publishes an LVM_EV_SNAPLV_THRESHOLD_REACHED event.
HP recommends that you monitor the syslog for the message or subscribe to the event. When the
threshold is reached, increase the number of extents in the pre-allocated pool to prevent the snapshot
from becoming over-committed. For more information, see Extending the pre-allocated extent pool
Beginning with the HP-UX 11i v3 September 2010 Update release, LVM provides a feature to
automatically increase the pre-allocated extents when the threshold value is reached and provides an
option to set the threshold value. For more information, see Enabling the automatic increase of pre-
allocated extents
Note
Although you can increase the number of extents in the pre-allocated pool,
you cannot reduce them.
Data unsharing can occur on a read-only and read-write snapshot logical volume. On a read-only
snapshot logical volume, data unsharing can occur because of a write I/O on its successor. On a
read-write snapshot logical volume, data unsharing can occur because of a write on the snapshot or
its successor. In either case, if the snapshot is space efficient, HP recommends you monitor for the
threshold of number of extents in its pre-allocated extent pool. Also, in case of deletion of a single
snapshot, data might get unshared on the predecessor of the snapshot being deleted. If the
predecessor is a space efficient snapshot, HP recommends you monitor for the threshold of
number of extents in its pre-allocated extent pool. For more information,
see Deleting logical volumes on a snapshot tree
If a logical volume has snapshots associated with it, there might be an increase in the latencies
associated with reads and writes on the original logical volume or the snapshot. The increased
latency is not incurred after the first write on a unshare unit. For more information on the performance
of I/Os on snapshot logical volumes, see Performance numbers
7
(for example, 512 KB), more unshare units are required to represent the data in one extent. If the
unshare unit is large (for example, 4 MB), the number of unshare units required is less. The increase
in metadata size from Version 2.1 to Version 2.2 volume groups (with the same volume group
capacity) depends on the size of the unshare unit. You must choose this value carefully based on the
size and the pattern of I/Os issued by the application using the volume group. LVM recommends you
use the following guidelines when choosing the size of unshare unit:
• If the write I/Os to the original logical volume or the snapshots are random and as small as one of
the unshare units, choose the unshare unit to which the typical I/O size is closest. If the write I/O is
larger than the largest unshare unit, choose the largest unshare unit. This applies to both raw and
block write I/Os.
• If the write I/Os to the original logical volume or the snapshots are sequential, choose an unshare
unit such that the total size of the group of sequential I/Os is closest to the unshare unit. This applies
to both raw and block write I/Os.
• If the application is read intensive (if the number of read I/Os are significantly more than the
number of write I/Os to the original logical volume or the snapshots) and the read I/Os are
random, choose an unshare unit that is closest to the size of the read I/O. This applies to both raw
and block read I/Os.
• If the application is read intensive (if the number of read I/Os are significantly more than the
number of write I/Os to the original logical volume or the snapshots) and the read I/Os are
sequential in nature, consider the following:
– For raw read I/Os, choose an unshare unit that is closest to the size of the read I/O.
– For block read I/Os, choose the largest unshare unit (for example, 4096 K).
For more information, see vgcreate(1M).
Creating snapshots
To create a snapshot of a logical volume, use the lvcreate –S option. By default, the name of the
snapshot is a string consisting of the original logical volume name, the tag _S, and the minor number
of the snapshot logical volume. The snapshot logical volume is treated as just another logical volume
in the volume group and contributes to the limit of maximum number of logical volumes in a volume
group. The maximum number of snapshots you can create for a particular logical volume is 255.
By default, a snapshot is created as a read-only logical volume. You cannot create a snapshot when
the volume group is quiesced.
The following rules apply to all snapshot logical volumes:
• The allocation policies of the snapshot are inherited from the original logical volume unless
specified explicitly; with the exception that contiguous allocation policy is not supported for
space-efficient snapshots. The allocation policy of a space-efficient snapshot is set to default
allocation when the original logical volume is configured for contiguous allocation.
• After the snapshot is created, you cannot change its configuration parameters, except for the access
permissions, availability, IO timeout, and consistency recovery attributes.
• You can stripe the snapshot only if the original logical volume is striped. You cannot create a
striped snapshot of a non-striped original logical volume, or vice versa.
• The scheduling policy is inherited from the original logical volume and cannot be changed.
• You cannot create snapshots off swap and dump logical volumes.
• You can create only fully-allocated snapshots off root and boot logical volumes. You cannot create
space-efficient snapshot of these logical volumes.
• You cannot create a snapshot of a snapshot logical volume.
• You cannot create a snapshot of a logical volume whose size is 0.
8
You can use the following options when creating a snapshot:
• The –S option takes only one value s to indicate that the logical volume being created is a
snapshot logical volume.
• To create a fully-allocated snapshot, do not use the –l or –L options.
• To create a space-efficient snapshot, use the -l option to specify the number of extents in the
pre-allocated pool or the -L option to specify the size of pre-allocated pool.
• Use the –m option to create a mirrored snapshot. If you do not specify the -m option, the snapshot
is created with no mirrors, even if the original logical volume is mirrored. It is possible to create a
mirrored snapshot of a non-mirrored original logical volume.
• Use the –n option to explicitly set the name of the snapshot logical volume.
• Use the -t option to append a timestamp of the snapshot creation to the snapshot logical volume
name. The timestamp is of the form YYYYMMDD_HH.MM.SS.
• Use the -p option to set the access permission at the time of snapshot creation. Because the
snapshot is read-only by default, use this option to create a read-write snapshot logical volume
if required.
• Use the –e option (HP-UX 11i v3 September 2010 release and later) to enable or disable the
automatic increase of pre-allocated extents. By default, the automatic increase of pre-allocated extents is
enabled. The lvmpud daemon must be running for this feature to be enabled. If not, it is disabled.
• Use the –P option (HP-UX 11i v3 September 2010 release and later) to set the threshold value at
which increment messages are logged in syslog or at which the automatic increase of pre-allocated
extents is triggered.
• You can use all other options, for example -c. -C, -D, -M, and –s, as for a normal logical volume.
Examples
• To create a read-only mirrored space-efficient snapshot of the logical volume /dev/vg01/lvol1
with default naming and 200 pre-allocated extents, enter the following command:
#lvcreate -S s -l 200 -m 1 /dev/vg01/lvol1
Logical volume "/dev/vg01/lvol1_S2" has been successfully created with
character device "/dev/vg01/rlvol1_S2".
Logical volume "/dev/vg01/lvol1_S2" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
9
character device "/dev/vg01/rlvol1_S2".
Logical volume "/dev/vg01/lvol1_S2" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
• To create a fully-allocated writeable snapshot of the logical volume /dev/vg01/lvol1, with the
name snap1 and the timestamp appended to this name, enter the following command:
#lvcreate -S s -n snap1 -t y –p w /dev/vg01/lvol1
Logical volume "/dev/vg01/snap1_20100122_00.36.18" has been successfully
created with character device "/dev/vg01/rsnap1_20100122_00.36.18".
Logical volume "/dev/vg01/snap1_20100122_00.36.18" has been successfully
extended.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
Note
When a logical volume snapshot is created, the logical volume is first
quiesced. After all I/Os that are in progress have completed, the I/Os on
the logical volume are paused for the duration of the snapshot creation.
There is no guarantee that the status of the snapshot will be the same as
that of the original logical volume when the lvcreate command was
initiated to create the snapshot. To ensure correctness of the snapshot
logical volume, HP recommends that the applications using the logical
volume be quiesced prior to initiating the snapshot creation.
10
• The number of extents or size of pre-allocated pool specified in the command is not greater than the
existing value.
• The snapshot logical volume is inoperative.
For example, you have a Version 2.2 volume group vg01 with logical volume /dev/vg01/lvol1
having a space-efficient snapshot /dev/vg01/lvol1_S2. When write I/Os are issued to the
original logical volume, some extents on the space-efficient snapshot get unshared.
# lvdisplay /dev/vg01/lvol1_S2
--- Logical volumes ---
LV Name /dev/vg01/lvol1_S2
VG Name /dev/vg01
LV Permission read-only
LV Status available/syncd, snapshot,space efficient
Snapshot Status operative
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 40
Current LE 10
Allocated PE 3
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation strict
IO Timeout (Seconds) default
Pre-allocated LE 5
Current pre-allocated LE 2
Unshared LE 3
Current pre-allocated PE 2
Original LV /dev/vg01/lvol1
Timestamp Tue Jan 26 16:17:42 2010
At this point, the threshold has not been reached. When more extents get unshared and the threshold
is reached, the following warning is displayed in the syslog:
LVM: WARNING: Snapshot LV (VG 128 0x000000, LV Number: 2) threshold value
reached. Please increase the number of pre-allocated extents for this
snapshot LV
The lvdisplay output shows the number of extents in the pre-allocated pool that were not picked for
any unshare operation in Current pre-allocated LE and the total number of extents that were
pre-allocated to the space-efficient snapshot in Pre-allocated LE. Increase the Pre-allocated
LE value to add more extents in the pre-allocated pool using lvextend.
In this example, when the threshold is reached, lvdisplay shows the following values:
Pre-allocated LE 5
Current pre-allocated LE 1
Unshared LE 4
Use lvextend to add more extents in the pre-allocated pool as follows:
# lvextend -l 8 /dev/vg01/lvol1_S2
Now, lvdisplay shows the following values:
Pre-allocated LE 8
Current pre-allocated LE 4
Unshared LE 4
For more information, see lvextend(1M).
11
Beginning with the HP-UX 11i v3 September 2010 Update release, LVM provides a feature to
automatically increase the pre-allocated extents when the threshold value is reached. For more
information, see Enabling the automatic increase of pre-allocated extents.
Note
The lvmpud daemon must be running for this feature to be enabled. Also,
ensure that a sufficient number of extents are present in the volume group
for the automatic increase of pre-allocated extents to succeed.
If the automatic increase of pre-allocated extents is not enabled and the threshold value is set, when
the number of free extents in the pre-allocated extent pool falls below the threshold value, a message
is logged in syslog and an event is published to the listening subsystems for the user to take action.
If neither the -e or -P options are specified, by default, the automatic increase of pre-allocated
extents is enabled and the threshold value is set to the default value.
After the task to automatically increase the pre-allocated extents is posted and it succeeds, LVM prints
the following messages in syslog:
lvmpud->lvextend -l 16 /dev/vg01/lvol1_S2
LVM: The task posted for increasing the pre-allocated extents succeeded
for the snapshot LV (VG 128 0x001000, LV Number: 2).
The lvmpud->lvextend in the preceding message indicates that lvextend was initiated by
lvmpud as a part of automatic increase of pre-allocated extents.
If the task posted to automatically increase the pre-allocated extents fails, the following message is
logged in syslog with appropriate error messages:
LVM: ERROR: The task posted for increasing the pre-allocated extents
failed for the snapshot LV (VG 128 0x001000, LV Number: 2)
If the number of pre-allocated extents incremented automatically is equal to the original logical volume
settings, the following message is logged and no further tasks are posted to lvmpud for further
increase:
LVM: The number of pre-allocated extents for snapshot LV(VG 128
0x001000,LV Number: 2) is equal to the original logical volume's setting.
The number of pre-allocated extents cannot be increased further.
12
Enabling the automatic increase of pre-allocated extents does not ensure that the snapshot logical
volume does not get marked as over-commit. You must select a proper threshold value based on the
purpose of snapshot, the duration for which the snapshot is kept, and the I/O activity on the original
logical volume.
If the I/O activity on the original logical volume is greater, choose a higher threshold value so the
threshold is reached faster and more pre-allocated extents are allocated at a time.
Example
An original logical volume /dev/vg01/lvol1 has 200 extents. For snapshot logical volume
/dev/vg01/lvol1_S2 with 100 extents and threshold value 70%, the lvdisplay output is
as follows:
# lvdisplay /dev/vg01/lvol1_S2
--- Logical volumes ---
LV Name /dev/vg01/lvol1_S2
VG Name /dev/vg01
LV Permission read-only
LV Status available/syncd, snapshot,space efficient
Snapshot Status operative
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 400
Current LE 200
Allocated PE 0
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation strict
IO Timeout (Seconds) default
Pre-allocated LE 100
Current pre-allocated LE 100
Unshared LE 0
Current pre-allocated PE 100
Original LV /dev/vg01/lvol1
Timestamp Wed Apr 28 14:01:14 2010
Auto Pre-allocation Enabled
Threshold Percent 70
When a write operation comes to an original logical volume, data unsharing is initiated on the
snapshot logical volume. If the number of extents in the pre-allocated pool size is less than or equal to
the threshold value, automatic increase of pre-allocated extents is initiated and the number of pre-
allocated extents increases by the threshold value.
In the previous example, if the number of extents remaining in the pre-allocated pool reaches the
threshold value (70% of number of pre-allocated extents), the number of pre-allocated extents is
automatically incremented by the threshold value (70 extents). Now, the number of pre-allocated
extents is 170.
The following is the output of lvdisplay of a snapshot logical volume /dev/vg01/lvol1_S2
after automatic increase of pre-allocated extents:
# lvdisplay /dev/vg01/lvol1_S2
--- Logical volumes ---
LV Name /dev/vg01/lvol1_S2
VG Name /dev/vg01
LV Permission read-only
LV Status available/syncd, snapshot,space efficient
Snapshot Status operative
13
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 400
Current LE 200
Allocated PE 30
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation strict
IO Timeout (Seconds) default
Pre-allocated LE 170
Current pre-allocated LE 140
Unshared LE 30
Current pre-allocated PE 140
Original LV /dev/vg01/lvol1
Timestamp Wed Apr 28 14:01:14 2010
Auto Pre-allocation Enabled
Threshold Percent 70
The next time, the threshold value is calculated as 70% of 170 extents. By increasing the
pre-allocated pool size by 70%, the size of the snapshot crosses the original logical volume size.
Therefore, it is increased to maximum size of original logical volume.
For more information on using this feature, see lvmpud(1M), lvcreate(1M), lvchange(1M),
and lvm(7).
14
For example, an I/O is issued on the original logical volume of a snapshot tree. The timeout value
for the original I/O is equal to 60 seconds, which means that the I/O is completed (either success
or failure) within 60 seconds. In this case, if the original I/O requires a CBW I/O, the CBW I/O is
also given a timeout value of 60 seconds; the I/O is still completed (either success or failure) within
60 seconds.
If the timeout value set for the original I/O is not enough for the completion of the original I/O and
CBW I/Os induced by it, the original I/O fails with an error indicating that the I/O time budget is
exhausted. Therefore, HP recommends you choose the I/O timeout value of logical volumes on a
snapshot tree that it is comparatively larger (keeping in mind that the original I/O might result in
one or more CBW I/Os) than the I/O timeout value chosen for a logical volume that is not on a
snapshot tree.
• -e — Enables or disables the automatic increase of pre-allocated extents. The default behavior is
to enable the feature. The lvmpud daemon must be running for this feature to be enabled. If not, it
is disabled.
• -P — Sets the percentage threshold value at which increment messages are logged in syslog, or
the automatic increase of preallocated extents is triggered. The value ranges from 1 to 100.
Note
Although the behavior of I/O timeout for logical volumes on snapshot
tree has changed, the behavior and interaction with the I/O timeout for
physical volumes has not changed.
Examples
• The output of lvdisplay for space-efficient snapshot /dev/vg01/lvol1_S2 is as follows:
Timestamp Tue Apr 27 13:21:20 2010
Auto Pre-allocation Enabled
Threshold Percent 30
To change the threshold value for /dev/vg01/lvol1_S2 from 30% to 60%, enter the following
command:
# lvchange -P 60 /dev/vg01/lvol1_S2
Logical volume "/dev/vg01/lvol1_S2" has been successfully changed.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
The following output of lvdisplay reflects the change in threshold percent:
Timestamp Tue Apr 27 13:21:20 2010
Auto Pre-allocation Enabled
Threshold Percent 60
15
The following output of lvdisplay reflects the changes:
Timestamp Tue Apr 27 13:21:20 2010
Auto Pre-allocation Disabled
Threshold Percent 70
• To enable the automatic increase of pre-allocated extents when lvmpud is not running, enter the
following command:
# lvchange -e y /dev/vgpj/lvol1_S2
The automatic increase of pre-allocated extents has been disabled
since lvmpud is not running. Please start the lvmpud daemon and
enable the feature using lvchange command.
Logical volume "/dev/vgpj/lvol1_S2" has been successfully changed.
Volume Group configuration for /dev/vgpj has been saved in
/etc/lvmconf/vgpj.conf
The automatic increase of pre-allocated extents is enabled only if lvmpud is running.
16
Figure 4: Deleting logical volumes on a snapshot tree
A A A
B X B
Y C C
Z D D
LV S1 S0
Deletion of a single snapshot can be a lengthy operation because of the unshare data copy. In
addition, the amount of data that is copied to the predecessor depends on the size of the logical
volume and the amount of data unshared on the logical volume being deleted.
To delete a snapshot and all its predecessors, use the lvremove -F option. Because the snapshot
and all its predecessors are deleted at the end of this operation, the shared data is not copied to the
snapshot predecessor. If the snapshot predecessors do not contain any valuable data or if all the
predecessors have been marked inoperative, HP recommends you use the -F option to delete all the
predecessors. The –F option is ignored if it is specified with the last predecessor on a snapshot tree.
For more information, see lvremove(1M).
Example
To delete all the snapshots of the original logical volume /dev/vg01/lvol1, follow these steps:
1. Identify the predecessor of the original logical volume using the Associated snapshots field of
lvdisplay output of the original logical volume as follows:
# lvdisplay /dev/vg01/lvol1
--- Logical volumes ---
LV Name /dev/vg01/lvol1
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 40
Current LE 10
Allocated PE 10
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation strict
IO Timeout (Seconds) default
Number of Snapshots 3
Associated snapshots /dev/vg01/lvol1_S4
/dev/vg01/lvol1_S3
/dev/vg01/lvol1_S2
In this example, /dev/vg01/lvol1_S4 is the immediate predecessor of the original
logical volume.
17
2. Use the lvremove –F option to delete snapshot /dev/vg01/lvol1_S4 and all its
predecessors as follows:
# lvremove -F /dev/vg01/lvol1_S4
Do you really want to delete the logical volume "/dev/vg01/lvol1_S4"
and all its predecessors (y/n) : y
Logical volume "/dev/vg01/lvol1_S4" and all its predecessors have been
successfully removed.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
If you do not use the –f option, you are asked to confirm the deletion.
lvmadm command
Use the lvmadm -V option to view the new fields (the last three) added for snapshot logical volumes
in Version 2.2 volume groups as follows:
# lvmadm -t -V 2.2
--- LVM Limits ---
VG Version 2.2
Max VG Size (Tbytes) 2048
Max LV Size (Tbytes) 256
Max PV Size (Tbytes) 16
Max VGs 2048
Max LVs 2047
Max PVs 2048
Max Mirrors 5
Max Stripes 511
Max Stripe Size (Kbytes) 262144
Max LXs per LV 33554432
Max PXs per PV 16777216
Max Extent Size (Mbytes) 256
Min Unshare unit(Kbytes) 512
Max Unshare unit(Kbytes) 4096
Max Snapshots per LV 255
vgdisplay command
The following new fields are added to vgdisplay command output for snapshot logical volumes:
• Cur Snapshot LV
Displays the total number of snapshot logical volumes configured in the volume group. Because a
snapshot logical volume is treated as another logical volume, the Cur LV and Open LV fields are
also incremented or decremented when a new snapshot is created or deleted, respectively.
18
• Current pre-allocated PE
Displays the total number of extents currently pre-allocated to all space-efficient snapshot logical
volumes in the volume group. When extents are picked from the pre-allocated pool of a particular
snapshot to cater to data unsharing or when a space-efficient snapshot is deleted, this value is
decremented. When you use lvextend to increase the pre-allocated pool size of a snapshot
logical volume, this value is incremented.
In the vgdisplay verbose output, the following new fields are added for snapshot logical volumes:
• Snapshot Status
Indicates the snapshot as operative, inoperative, or over-commit.
• Pre-allocated LE
Displays the total number of extents that have been pre-allocated for a space-efficient snapshot. This
value is incremented when the number of extents in the pre-allocated pool is increased using
lvextend. This field is not displayed for a fully-allocated snapshot.
• Current pre-allocated LE
Displays the number of logical extents currently present in the pre-allocated extents pool. This value
excludes those extents that have already been picked for unsharing. This field is not displayed for a
fully-allocated snapshot.
• Current pre-allocated PE
Displays the number of physical extents corresponding to Current pre-allocated LE and
the number of mirror copies of the space-efficient snapshot. This field is not displayed for a
fully-allocated snapshot.
• Unshared LE
Displays the number of extents of the snapshot logical volume that have been unshared.
In the vgdisplay verbose output, the following new field is added for physical volumes:
• Current pre-allocated PE
Displays the total number of physical extents of the physical volume that are present in the
pre-allocated pool of all the snapshot logical volumes of the volume group. This value represents
those extents that have not yet been picked for unshare.
The following is the vgdisplay output of a Version 2.2 volume group vg01, which has two
snapshot logical volumes. The unshare unit of the volume group is 2 MB and the maximum volume
group capacity is 128 t. Both snapshots are created off an original logical volume of 1 GB size,
therefore the current snapshot capacity in the volume group is shown as 2 GB. The Current
pre-allocated PE shows the total pre-allocated extents of all the snapshot logical volumes in the
volume group.
19
The status of the logical volume specifies the type of snapshot logical volume (space-efficient or fully-
allocated). In this example, both the snapshots are operative. For the space-efficient snapshot, the
pre-allocated LE shows the total number of extents set aside for unsharing (50) and Unshared LE
shows the number of unshared extents (2). The difference between these two values is the number of
extents currently available for unsharing in the pre-allocated pool. This value is shown in
Current pre-allocated LE as 48. The space-efficient snapshot has one mirror copy, so the
Current pre-allocated PE shows the number of physical extents in the pre-allocated pool for all
mirror copies of the snapshot logical volume. For the fully-allocated snapshot, the Unshared LE is 0,
implying that it shares all its data with its successor.
# vgdisplay -v vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 2047
Cur LV 3
Open LV 3
Cur Snapshot LV 2
Max PV 2048
Cur PV 2
Act PV 2
Max PE per PV 2097152
VGDA 4
PE Size (Mbytes) 8
Unshare unit size (Kbytes) 2048
Total PE 5048
Alloc PE 356
Current pre-allocated PE 96
Free PE 4692
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 128t
VG Max Extents 16777216
Cur Snapshot Capacity 2g
Max Snapshot Capacity 128t
20
LV Name /dev/vg01/lvol1_S3
LV Status available/syncd, snapshot,fully allocated
Snapshot Status operative
LV Size (Mbytes) 1024
Current LE 128
Allocated PE 128
Unshared LE 0
Used PV 1
PV Name /dev/disk/disk15820
PV Status available
Total PE 2524
Free PE 2474
Current pre-allocated PE 48
Autoswitch On
Proactive Polling On
pvdisplay command
The following new fields are added in the pvdisplay output for snapshot logical volumes:
• Current pre-allocated PE
Displays the total number of physical extents of the physical volume that are present in the
pre-allocated pool of any of the snapshot logical volumes of the volume group.
• Unshared LE on LV
Represents the number of logical extents of each snapshot logical volume in the volume group that
have been unshared to an extent on this physical volume. This field is displayed in pvdisplay
verbose output in the distribution of physical volumes section.
• pre-allocated status
A new status in the Physical Extents section. Indicates those extents of the physical volume that
are currently present in the pre-allocated pool, but have not been unshared. The snapshot logical
volume to which these extents are mapped is also displayed for each such extent. The logical extent
number is set to NO_LXINDEX to indicate that these extents are not yet mapped to a logical extent,
but have been set aside for a future unshare operation.
The following pvdisplay verbose output shows a physical volume with a total of 48 pre-allocated
extents. The physical volume has its extents mapped to the logical extents of the original logical
volume and both its snapshots. Two physical extents of this physical volume are mapped to unshared
extents of the space-efficient snapshot /dev/vg01/lvol1_S2. No physical extent of the physical
volume is mapped to any unshared extent of the fully-allocated snapshot /dev/vg01/lvol1_S3.
The partial output of the physical extent to logical extent map shows that physical extents 128 and
129 are mapped to unshared logical extents 0 and 1 of the space-efficient snapshot
/dev/vg01/lvol1_S2 and the remaining physical extents from 132 to 177 are pre-allocated.
Because pre-allocated extents are not mapped to any logical extents, the logical extent number is
shown as NO_LXINDEX. Physical extents from 178 to 305 are mapped to the fully-allocated
snapshot; the physical extents that follow are free.
21
# pvdisplay -v /dev/disk/disk15476
--- Physical volumes ---
PV Name /dev/disk/disk15476
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 3
PE Size (Mbytes) 8
Total PE 2524
Free PE 2218
Current pre-allocated PE 48
Allocated PE 306
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On
22
lvdisplay command
The following new fields are added to the lvdisplay output of a logical volume with snapshots:
• Number of snapshots
Displays the number of snapshots associated with the logical volume. If the logical volume has no
snapshots configured, this value is 0.
• Associated snapshots
Displays a list of all the snapshots associated with this logical volume. The snapshots are listed in
the reverse order of snapshot creation; the oldest snapshot is displayed last in the list and the most
recent snapshot is displayed first in the list.
The following new or modified fields are added to the lvdisplay output of a snapshot
logical volume:
• LV Status
Indicates the type of snapshot logical volume. This is a modified field.
• Snapshot Status
Indicates whether a snapshot is operative, inoperative, or over-commit.
• Pre-allocated LE
Represents the total number of extents that have been pre-allocated for a space-efficient snapshot.
This field is not displayed for a fully-allocated snapshot.
• Current pre-allocated LE
Displays the number of logical extents currently present in the pre-allocated extents pool. This value
excludes those extents that have already been picked for unsharing. This field is not displayed for a
fully-allocated snapshot.
• Current pre-allocated PE
Represents the number of physical extents corresponding to Current pre-allocated LE and the
number of mirror copies of the space-efficient snapshot. This field is not displayed for a fully-
allocated snapshot.
• Unshared LE
Displays the number of extents of the snapshot logical volume that have been unshared.
• Original LV
Displays the name of the original logical volume of which this logical volume is a snapshot.
• Timestamp
Displays the time at which the snapshot was created.
• Unshared LE and unshared PE
In the distribution of logical volumes section, displays the number of unshared logical and physical
extents for each physical volume on which extents of the logical volume are mapped.
• Unshared Logical extents
Displays the mapping of all unshared logical extents to the corresponding physical extents. This
section is not displayed for a fully-allocated snapshot and if a space-efficient snapshot does not
have any unshared extents.
• Pre-allocated extents
Displays the extents that are currently present in the pre-allocated pool of the space-efficient
snapshot. This section is not displayed for a fully-allocated snapshot.
• Shared status
A new status in the Logical Extents section. Indicates the extent shares its data with its successor.
This status is displayed only for fully-allocated snapshots.
23
• Auto pre-allocation
Indicates whether the automatic increase of pre-allocated extents is enabled or not. This is displayed
only for space efficient snapshots beginning with the HP-UX 11i v3 September 2010 Update
release.
• Threshold Percent
Displays the threshold percentage at which increment messages are logged in syslog and the
automatic increase of pre-allocated is triggered. This is displayed only for space efficient snapshots
beginning with the HP-UX 11i v3 September 2010 Update release.
Beginning with the HP-UX 11iv 3 September 2010 Update release, the Distribution of logical
volume section has the following changes:
• It displays only the Unshared LE and Unshared PE fields for space efficient snapshots. In the
HP-UX 11i v3 March 2010 Update release, the LE on PV, PE on PV, Unshared LE, and
Unshared PE fields were displayed for space-efficient and fully-allocated snapshots.
• It is not displayed for a space-efficient snapshot if it does not have any unshared extents.
24
--- Distribution of logical volume ---
PV Name Unshared LE Unshared PE
/dev/disk/disk15476 2 2
/dev/disk/disk15820 2 2
25
--- 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
.
.
.
26
example, /dev/vg01/snap1 might correspond to /dev/vg01/lvol1_S3 and
/dev/vg01/snap2 might correspond to /dev/vg01/lvol1_S2 or vice-versa. If the original
logical volume also had a user-defined name before exporting the volume group, it is more difficult to
map the new device special files of the snapshot logical volumes with their user-defined names.
To avoid this, generate the map file containing logical volume names during vgexport operation
and use the same map file during the vgimport operation.
Examples
• To migrate a Version 1.0 volume group vg01 with some physical volumes and some logical
volumes to a Version 2.2 volume group with an unshare unit 2048 KB, enter the following command:
# vgversion -V 2.2 -U 2048 -v vg01
• If you try to migrate a Version 2.2 volume group vg01 with some snapshot logical volumes to a
previous 2.x version (for example, Version 2.1), the vgversion command fails as follows:
# vgversion -V 2.1 vg01
Performing "vgchange -a y -l -p -s vg01" to collect data
Activated volume group.
Volume group "vg01" has been successfully activated.
vgversion: Error: The specified volume group contains snapshot
logical volumes.
Please delete the snapshot logical volumes for vgversion to proceed.
27
pvmove , vgmove, and lvmove commands
If a physical volume of a Version 2.2 volume group has pre-allocated extents of a space efficient
snapshot mapped to it, you cannot use the pvmove automatic rebalance feature on this physical volume. In
this case, use the pvmove legacy functionality that does not perform the automatic rebalance of extents.
The vgmove operation succeeds even if the physical volumes involved in migration have pre-allocated
extents of a space-efficient snapshot mapped to it.
You cannot use lvmove to migrate extents of a logical volume from one set of physical volumes to
another set of physical volumes belonging to a Version 2.2 volume group if the logical volume is a
space-efficient snapshot and the migration involves moving one or more of its pre-allocated extents.
vgreduce command
You cannot remove a physical volume that has pre-allocated extents from a volume group using the
vgreduce command. For vgreduce to succeed, free up the pre-allocated extents using lvremove
and then run vgreduce.
If you run vgreduce with the -f option on a volume group that has missing physical volumes, and if
any of these physical volumes have pre-allocated extents, vgreduce reports information about these
extents. In this case, free up the pre-allocated extents using lvremove and then re-run vgreduce.
vgchange command
Each time the configuration of a volume group changes (with a LVM configuration command), the
configuration backup file is updated automatically, unless disabled by the user explicitly. For a
Version 2.2 volume group with snapshots configured, information related to the data sharing between
a logical volume and its successor and predecessor is also maintained on disk. This information changes
when a write I/O requires data unsharing. However, this change is not updated in the configuration
file of the volume group for each write I/O. When you use this configuration file to restore to a set of
physical volumes, the data sharing information is stale and can cause data corruption.
To prevent this, vgchange is enhanced to automatically take a backup of the configuration file when
a Version 2.2 volume group is deactivated. If you choose to skip the automatic backup of the
configuration file using the –A n option and use this configuration file to restore all the physical
volumes of the volume group, the correctness of data in the snapshot logical volumes cannot be
guaranteed for the reason mentioned previously. Therefore, HP recommends you not bypass the
update to the configuration file during a volume group deactivation to ensure that the latest data
sharing details are saved in the configuration file.
For more information, see vgchange(1M).
28
Configurable location for the volume group configuration file
Because of the increased on-disk metadata size for a Version 2.2 volume group, the configuration file
size can also increase each time a snapshot is created. For more information on the size of
configuration file when snapshots are configured, see Configuration file size
The default location where the configuration file is stored is /etc/lvmconf. The space in the /etc
file system might not be sufficient to store the configuration file of too many Version 2.2 volume
groups with large snapshot capacity and several snapshots configured. To overcome this problem,
you can configure the location of the configuration file with the LVMCONFPATH_NON_BOOT variable
defined in file /etc/lvmrc. To configure the default location for backing up a volume group
configuration for Version 2.2 and above, edit the /etc/lvmrc file and set the variable to the
appropriate location to be used to store the configuration files. After you make this change, all future
configuration backups and restores use this location for Version 2.2 and higher volume groups. This
configuration is applicable only for non-bootable volume groups with Version 2.2 or higher.
For more information, see vgcfgbackup(1M) and vgcfgrestore(1M).
29
Common use examples
The following examples are based on a Version 2.2 volume group vg01 with an 8 MB extent size
and maximum snapshot capacity of 128 TB and an unshare unit of 4 MB. The volume group has a
logical volume /dev/vg01/lvol1 of size 10 GB, with a file system created on it that has the
following files:
# ll /mnt_lvol1/
total 1070408
-rwxrwxrwx 1 root sys 137011480 Jan 26 16:49 file1
-rwxrwxrwx 1 root sys 137011480 Jan 26 16:49 file2
-rwxrwxrwx 1 root sys 137011480 Jan 26 16:49 file3
-rwxrwxrwx 1 root sys 137011480 Jan 26 16:49 file4
drwxr-xr-x 2 root root 96 Jan 26 16:45 lost+found
1. Create a space efficient snapshot of the logical volume /dev/vg01/lvol1 with 50 pre-allocated
extents as follows:
# lvcreate -S s -l 50 –p w /dev/vg01/lvol1
Note
The contents are the same as that of the original logical volume.
30
Note
The changes are not reflected in its snapshot. (/mnt_S2 does not
have file5)
4. During the write operation to the original logical volume, ensure that the threshold is not reached
on its space-efficient snapshot. If the threshold is reached, increase the number of extents in the
pre-allocated pool as explained in Extending the pre-allocated extent pool or enable the automatic
increase of pre-allocated extents as explained in Enabling the automatic increase of pre-allocated
extents. Failing to do so can make the space-efficient snapshot over-commit and inoperative.
# lvdisplay /dev/vg01/lvol1_S2
--- Logical volumes ---
LV Name /dev/vg01/lvol1_S2
VG Name /dev/vg01
LV Permission read-only
LV Status available/syncd, snapshot,space efficient
Snapshot Status inoperative/over-commit
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 10240
Current LE 1280
Allocated PE 50
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation strict
IO Timeout (Seconds) default
Pre-allocated LE 50
Current pre-allocated LE 0
Unshared LE 50
Current pre-allocated PE 0
Original LV /dev/vg01/lvol1
Timestamp Tue Jan 26 16:56:37 2010
5. You can neither read from nor write to an inoperative snapshot. You must delete it. Before deleting
a snapshot, unmount the file system (if mounted) as follows:
# umount /mnt_S2/
# lvremove -f /dev/vg01/lvol1_S2
Logical volume "/dev/vg01/lvol1_S2" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf
Note
When a snapshot becomes inoperative, all its predecessors are
also marked inoperative, if they share data with the snapshot.
In these cases, you can delete all the predecessors using the
lvremove -F option).
31
Recommended practices
The following practices are recommended when Version 2.2 volume groups are configured
with snapshots:
• The size of the configuration file is bigger for Version 2.2 volume groups. Set the location of the
configuration file in the variable LVMCONFPATH_NON_BOOT in the /etc/lvmrc file and ensure
that sufficient space is allocated to this location to hold the large configuration files.
• Based on the type of application, choose the unshare unit based on the guidelines mentioned in
Creating a version 2.2 (or higher) volume group
• Do not override the automatic backup of configuration file done by vgchange.
• When you back up the configuration file of a volume group with snapshots, ensure that there are no
I/Os in progress so that the configuration file has latest sharing information.
• When you use the configuration file of a Version 2.2 volume group with snapshots to restore the
configuration on all available physical volumes of a volume group, ensure that the configuration file
is updated with the data sharing information of the snapshots to prevent data corruption on
the snapshots.
• To ensure correctness of the data in a snapshot logical volume, HP recommends that applications
using the logical volume be quiesced prior to initiating the snapshot creation.
• For logical volumes on a snapshot tree, set the timeout to a larger value to accommodate the CBW
I/Os induced by a write I/O on any logical volume on the snapshot tree. For more information, see
Changing the attributes of a snapshot logical volume
• When you import a volume group with snapshots, to retain the user-defined names of the snapshot
logical volumes, use a map file generated by a corresponding vgexport operation. For more
information, see Importing volume groups with snapshots
• In very low system memory conditions, deletion of a single snapshot can hang indefinitely for
memory to become available. Ensure that sufficient memory is available during deletion of a single
snapshot that requires data to be copied to its predecessor. If the lvremove command hangs in these
cases, increase the system memory or free some existing system memory to proceed with the snapshot
deletion.
• To restore data on the original logical volume, if you copy the entire contents of its space-efficient
snapshot, the shared data on the space-efficient snapshot is unshared. Before performing the data
restore, ensure that enough extents are pre-allocated to the space efficient snapshot or selectively
copy only the unshared data of the snapshot to its original logical volume. Alternatively, if you want
to restore the entire contents of the snapshot to its original logical volume, use a fully-
allocated snapshot.
Error messages
When snapshots are configured, under certain conditions, you might see the following
error messages:
• Error: Exceeds the maximum supported snapshot capacity (4194304 MB)
for the specified volume group /dev/vg01.
During snapshot creation, lvcreate reports that the creation of a new snapshot for the specified
original logical volume cannot be performed as the resulting current snapshot capacity will exceed
the maximum supported snapshot capacity for this volume group. This can occur when the size of
the logical volume for which the snapshot creation is requested is more than the total snapshot
capacity remaining in the volume group. Use vgmodify to increase the maximum volume group
32
size, which increases the maximum snapshot capacity to an equivalent value, or delete any of the
snapshots that are not needed or in use.
33
The pvmove operation fails if the logical volumes specified are inoperative or if the physical
volumes specified contain logical volumes that are inoperative. Delete all such inoperative snapshot
logical volumes that have caused the pvmove operation to fail and retry.
• Warning: The volume group configuration for volume group "/dev/vg01" has
not been backed up. If the existing configuration backup file is
restored on to all the physical volumes, then, the data contained in the
logical volumes may be corrupt after the next activation. It is
recommended that the volume group be deactivated only after the volume
group configuration is backed up successfully.
34
If a Version 2.2 volume group is deactivated using the vgchange –A n option to skip the
automatic backup of configuration file, this warning is displayed. If the Version 2.2 volume group
contains snapshots, HP recommends that you deactivate the volume group after backing the
configuration file. Do not use the vgchange –A n option if you want to back up the configuration
file before deactivating the volume group.
Performance numbers
With the HP-UX 11i v3 March 2010 Update release, there is no performance degradation for read
and write I/Os on a logical volume that has no snapshots associated with it. Also, when a snapshot is
created, the read I/O performance on the original logical volume does not show any degradation.
Read performance
When snapshots are involved, the performance of read I/Os on the snapshot logical volume has the
following performance degradation:
• Raw random read I/Os on snapshot logical volumes have an average performance degradation of
5%. When the original logical volume and the snapshot are striped, expect up to a 5 to 6%
performance degradation.
• Raw sequential read I/Os on snapshot logical volumes have an average performance degradation
of 15%. When the original logical volume and the snapshot are striped, expect up to a 25%
performance degradation.
• Block random read I/Os on snapshot logical volumes have an average performance degradation
of 1%. When the original logical volume and the snapshot are striped, expect up to a 6%
performance degradation.
• Block sequential read I/Os on snapshot logical volumes have an average performance degradation
of 1%. When the original logical volume and the snapshot are striped, expect up to an 8%
performance degradation.
Note
Over time, as more and more data is unshared between the original logical
volume and its snapshots, the performance degradation of read I/Os
gradually reduces.
35
Write performance
Performance of the first write I/O on a shared region of a logical volume with a snapshot is low
compared to that of a logical volume without snapshots or a logical volume with a single mirror copy.
This is because the write I/O requires data to be unshared on the predecessor of the original logical
volume. Over a period of time, as the snapshot data is unshared, write I/O performance on the
logical volume with a snapshot reaches that of a logical volume with one mirror and finally nears that
of a logical volume with no mirrors or snapshots.
Note
A logical volume with no mirror copies has better write performance when
compared to that of a logical volume with one or more mirror copies.
The following table shows the results of a performance test of write I/Os on a 1000 GB logical
volume when it has no mirrors, when it has one mirror copy, and when it has a snapshot associated.
Note
The tests were run on a volume group with a maximum volume
group capacity of 128 TB, 4 MB extent size, 1 MB unshare unit,
and 8 KB chunks of write I/Os were issued.
In case of raw random and raw sequential write I/O, the write performance on the first attempt is low
compared to that of a non-mirrored or mirrored logical volume with no snapshots. As more data is
unshared over a period of time, the response time of the write I/O on the logical volume with
snapshot associated with it improves and nears the performance on the mirrored logical volume and
then equals the performance on the non-mirrored logical volume. In case of block random and
sequential write I/O, the performance degradation is very low and almost negligible.
The following graphs show the performance (in terms of response time) of 8 KB and 2048 KB random
raw write I/Os on a logical volume with no mirrors, with a single mirror, and with a single snapshot.
The volume group has a 4 MB extent size and 1 MB unshare unit.
36
Figure 5: Raw random 8 KB Write I/Os
37
The first instance of a write to the logical volume with snapshot takes more time and over a period of
time, the time taken equals to that of a mirrored logical volume with no snapshots, and then reduces
to that of a non-mirrored logical volume with no snapshots.
The increase in size of the configuration file is less for a space-efficient snapshot creation because at
the point of snapshot creation, entire data is shared with the original logical volume and no physical
extents are set aside on disk for the snapshot. Over time, as unsharing of a space efficient snapshot
progresses, the snapshot gets its own copy of data and the extent mapping on disk is updated to
include the new physical extents. When the entire space-efficient snapshot is unshared, the increase in
size of configuration file is equivalent to the size of a fully-allocated snapshot of similar configuration.
The configuration file does not get updated automatically after each data unshare operation. So the
increase is the file size is seen only when the configuration file is backed up explicitly using
vgcfgbackup or during a configuration change that takes automatic backup of the file. If you
choose to compress the configuration file to reduce the file size, a subsequent configuration operation
that performs automatic backup of the configuration file recreates the file (uncompressed file).
Note
When you back up the configuration file of a volume group with snapshots,
ensure that there are no I/Os in progress so that the configuration file has
the latest sharing information.
38
For more information
To learn more about LVM and HP-UX system administration, see the following documents on the
HP Business Support Center at: http://www.hp.com/go/hpux-LVM-VxVM-docs
• HP-UX System Administrator's Guide: Logical Volume Management
• HP-UX Logical Volume Manager and MirrorDisk/UX Release Notes
• LVM White Papers (the Release Notes lists all white papers)
Feedback
Please give your comments about this white paper, or suggestions for LVM or related documentation,
through our technical documentation feedback portal:
http://www.hp.com/bizsupport/feedback/ww/webfeedback.html
© Copyright 2010 Hewlett-Packard Development Company, L.P. The information contained herein is subject to
change without notice. The only warranties for HP products and services are set forth in the express warranty
statements accompanying such products and services. Nothing herein should be construed as constituting an
additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.