LVM 'snapshot-merge' target not output via 'dmsetup targets' on RHEL 6
Environment
- Red Hat Enterprise Linux 6
Issue
- The RHEL 6 man page for
lvconvertspecifies the following:
--merge
Merges a snapshot into its origin volume or merges a raid1 image that has been split from its mirror with --trackchanges back into its mirror.
To check if your kernel supports the snapshot merge feature, look for ’snapshot-merge’ in the output of ’dmsetup targets’.
- However, the output of
dmsetup-targetsdoes not include the expectedsnapshot-mergetarget, as follows:
[root@host ~]# dmsetup targets
mirror v1.12.0
striped v1.4.1
linear v1.1.0
error v1.0.1
Resolution
- Either run an
lvconvert --mergeoperation, which loads the module automatically, or load the module viamodprobe, as follows:
[root@host ~]# modprobe dm-snapshot
Root Cause
-
The
snapshot-mergetarget gets included when thedm-snapshotmodule is loaded, which can either be achieved throughmodprobe dm-snapshotor by running anlvconvert --mergeoperation. If thedm-snapshotmodule is present, then the target should load successfully. -
The
dm-snapshotmodule is included within the kernel for RHEL 6, as we can see in the following example:
$ modinfo ./lib/modules/2.6.32-279.11.1.el6.x86_64/kernel/drivers/md/dm-snapshot.ko
filename: ./lib/modules/2.6.32-279.11.1.el6.x86_64/kernel/drivers/md/dm-snapshot.ko
license: GPL
author: Joe Thornber
description: device-mapper snapshot target
srcversion: 8B0ADB0071DDCBBD2FD8D35
depends: dm-mod
vermagic: 2.6.32-279.11.1.el6.x86_64 SMP mod_unload modversions
- After loading the module (or running an
lvconvert --mergeoperation) on RHEL 6, we see that the expected target is output when we run 'dmsetup targets':
# modprobe dm-snapshot
# dmsetup targets
snapshot-merge v1.1.0
snapshot-origin v1.7.1
snapshot v1.10.0
mirror v1.12.0
striped v1.4.1
linear v1.1.0
error v1.0.1
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
