Updated: 9 October 2026 · Applies to: Linux device-mapper with LVM, LUKS and multipath on RHEL 9 and 10, AlmaLinux, Rocky Linux, Debian 13 and Ubuntu; tools checked: dmsetup 1.02.205, LVM 2.03.31, multipath-tools 0.11.1 and util-linux 2.41.5 (Debian 13)

The device mapper is the part of the Linux kernel that builds virtual block devices on top of real disks. LVM logical volumes, LUKS encrypted volumes (dm-crypt) and multipath devices are all device-mapper devices. The kernel names them dm-0, dm-1 and so on, and udev adds readable names under /dev/mapper. To see which disk sits under each one:

lsblk -o NAME,KNAME,MAJ:MIN,TYPE,SIZE,MOUNTPOINTS   # tree of disks, partitions and dm devices
sudo dmsetup ls --tree                              # dm devices and what they sit on
sudo dmsetup deps -o devname                        # underlying devices by name

How the device mapper works

Each device-mapper device has a table that maps its sectors to one or more targets. According to the dmsetup manual, every table line has the form start_sector number_of_sectors target_type target_arguments. Common targets:

  • linear: a range of another device (plain LVM volumes)
  • striped and raid: data spread over several devices
  • crypt: encryption (LUKS, encrypted swap)
  • multipath: one LUN reached over several paths
  • thin and thin-pool: thin provisioning; snapshot: LVM snapshots

You rarely create these by hand: lvcreate, cryptsetup and multipathd do it for you. The kernel gives device mapper its own block major number; on our test server it was 253:

$ grep device-mapper /proc/devices
253 device-mapper

The names you will see

  • /dev/dm-N: the kernel name. The number depends on activation order. Red Hat's multipath guide says devices of the form /dev/dm-X "are for internal use only and should never be used by the administrator directly".
  • /dev/mapper/NAME: a symlink to ../dm-N made by the udev rule SYMLINK+="mapper/$env{DM_NAME}" that ships with the device-mapper tools. udev also adds /dev/disk/by-id/dm-name-NAME and dm-uuid-UUID links.
  • LVM: /dev/mapper/VG-LV and /dev/VG/LV. A hyphen inside a VG or LV name is doubled in the mapper name. dmsetup splitname shows the parts:
    $ dmsetup splitname my--vg-web--data LVM
    VG    LV       LVLayer
    my-vg web-data
    The LVM manual recommends the /dev/VG/LV form in scripts, because the escaping in /dev/mapper may change.
  • Multipath: /dev/mapper/mpathN with user_friendly_names yes, otherwise /dev/mapper/WWID, according to Red Hat.
  • LUKS: the name you gave cryptsetup open or /etc/crypttab.

1. Map dm-N to its /dev/mapper name

  1. ls -l /dev/mapper/: each name points to ../dm-N.
  2. cat /sys/block/dm-9/dm/name: the kernel prints the name for dm-9 directly (and .../dm/uuid its UUID).
  3. lsblk -o NAME,KNAME: NAME shows the mapper name and KNAME the dm-N next to it.
  4. sudo dmsetup info -c: one line per dm device, with columns such as name, major and minor number, open count and UUID.

2. Find the disk under a /dev/mapper device

  1. lsblk -s /dev/mapper/NAME prints the tree upside down: the dm device first, then the partition and disk it is built on.
  2. sudo dmsetup deps -o devname NAME lists the devices it depends on by name (by default dmsetup prints major:minor pairs).
  3. In sysfs, ls /sys/block/dm-0/slaves/ lists the devices under dm-0, and ls /sys/block/sda/sda2/holders/ lists the dm devices built on sda2.
  4. For LVM, sudo lvs -a -o +devices adds a column with the physical volumes each logical volume uses (Red Hat uses this in its LVM guide).
  5. For multipath, sudo multipath -ll lists each multipath device with its WWID, its dm-N and the sdX paths under it. See dm-multipath identifiers and the multipath utility.

3. The manual way: match major:minor numbers

sudo dmsetup table NAME shows the table. For a plain LVM volume each line is a linear target (one line per segment) whose arguments are the underlying device as major:minor and the starting sector on it, for example linear 8:2 2048. Then find the device with that number:

$ lsblk -o NAME,KNAME,MAJ:MIN,TYPE,SIZE,MOUNTPOINTS
NAME   KNAME MAJ:MIN TYPE  SIZE MOUNTPOINTS
sda    sda     8:0   disk   50G
|-sda1 sda1    8:1   part 48.8G
`-sda2 sda2    8:2   part  1.2G [SWAP]

Here 8:2 is sda2. (Our test server has no device-mapper devices, so this listing shows only the disk and its partitions. On an LVM server each logical volume appears under its partition with TYPE lvm, an encrypted volume with TYPE crypt and a multipath device with TYPE mpath.) ls -l /dev/sd* shows the same pair as 8, 2 in the size column.

Errors and safe practice

  • Inside an unprivileged container, dmsetup cannot reach the kernel and fails with:
    /dev/mapper/control: mknod failed: Operation not permitted
    Failure to communicate with kernel device-mapper driver.
    Check that device-mapper is available in the kernel.
    Run it as root on the host itself (we hit this in our test container).
  • In /etc/fstab use the /dev/mapper or /dev/VG/LV name, or a filesystem UUID, never /dev/dm-N.
  • Remove dm devices with the tool that made them (lvchange -an, cryptsetup close, multipath -f), not with dmsetup remove.
  • pvcreate on a multipath device says it is "not found (or ignored by filtering)"? See pvcreate fails on /dev/mapper/mpatha.

Related: resize LVM volumes and encrypt swap with dm-crypt.

Official documentation: dmsetup(8), kernel device-mapper documentation and Red Hat: multipath devices.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)