Installation guide

Merging Snapshot Volumes
41
Warning
Because the snapshot increases in size as the origin volume changes, it is important to monitor
the percentage of the snapshot volume regularly with the lvs command to be sure it does not fill.
A snapshot that is 100% full is lost completely, as a write to unchanged parts of the origin would
be unable to succeed without corrupting the snapshot.
4.4.5. Merging Snapshot Volumes
As of the Red Hat Enterprise Linux 6 release, you can use the --merge option of the lvconvert
command to merge a snapshot into its origin volume. If both the origin and snapshot volume are not
open, the merge will start immediately. Otherwise, the merge will start the first time either the origin
or snapshot are activated and both are closed. Merging a snapshot into an origin that cannot be
closed, for example a root file system, is deferred until the next time the origin volume is activated.
When merging starts, the resulting logical volume will have the origin’s name, minor number and
UUID. While the merge is in progress, reads or writes to the origin appear as they were directed to the
snapshot being merged. When the merge finishes, the merged snapshot is removed.
The following command merges snapshot volume vg00/lvol1_snap into its origin.
# lvconvert --merge vg00/lvol1_snap
You can specify multiple snapshots on the command line, or you can use LVM object tags to specify
that multiple snapshots be merged to their respective origins. In the following example, logical volumes
vg00/lvol1, vg00/lvol2, and vg00/lvol3 are all tagged with the tag @some_tag. The following
command merges the snapshot logical volumes for all three volumes serially: vg00/lvol1, then
vg00/lvol2, then vg00/lvol3. If the --background option were used, all snapshot logical
volume merges would start in parallel.
# lvconvert --merge @some_tag
For information on tagging LVM objects, see Appendix C, LVM Object Tags. For further information on
the lvconvert --merge command, see the lvconvert(8) man page.
4.4.6. Persistent Device Numbers
Major and minor device numbers are allocated dynamically at module load. Some applications work
best if the block device always is activated with the same device (major and minor) number. You can
specify these with the lvcreate and the lvchange commands by using the following arguments:
--persistent y --major major --minor minor
Use a large minor number to be sure that it has not already been allocated to another device
dynamically.
If you are exporting a file system using NFS, specifying the fsid parameter in the exports file may
avoid the need to set a persistent device number within LVM.