LVM 'snapshot-merge' target not output via 'dmsetup targets' on RHEL 6

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • The RHEL 6 man page for lvconvert specifies 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-targets does not include the expected snapshot-merge target, 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 --merge operation, which loads the module automatically, or load the module via modprobe, as follows:
[root@host ~]# modprobe dm-snapshot

Root Cause

  • The snapshot-merge target gets included when the dm-snapshot module is loaded, which can either be achieved through modprobe dm-snapshot or by running an lvconvert --merge operation. If the dm-snapshot module is present, then the target should load successfully.

  • The dm-snapshot module 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 --merge operation) 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.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.