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)stripedandraid: data spread over several devicescrypt: encryption (LUKS, encrypted swap)multipath: one LUN reached over several pathsthinandthin-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-Nmade by the udev ruleSYMLINK+="mapper/$env{DM_NAME}"that ships with the device-mapper tools. udev also adds/dev/disk/by-id/dm-name-NAMEanddm-uuid-UUIDlinks.- LVM:
/dev/mapper/VG-LVand/dev/VG/LV. A hyphen inside a VG or LV name is doubled in the mapper name.dmsetup splitnameshows the parts:$ dmsetup splitname my--vg-web--data LVM VG LV LVLayer my-vg web-data
The LVM manual recommends the/dev/VG/LVform in scripts, because the escaping in/dev/mappermay change. - Multipath:
/dev/mapper/mpathNwithuser_friendly_names yes, otherwise/dev/mapper/WWID, according to Red Hat. - LUKS: the name you gave
cryptsetup openor/etc/crypttab.
1. Map dm-N to its /dev/mapper name
ls -l /dev/mapper/: each name points to../dm-N.cat /sys/block/dm-9/dm/name: the kernel prints the name fordm-9directly (and.../dm/uuidits UUID).lsblk -o NAME,KNAME: NAME shows the mapper name and KNAME thedm-Nnext to it.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
lsblk -s /dev/mapper/NAMEprints the tree upside down: the dm device first, then the partition and disk it is built on.sudo dmsetup deps -o devname NAMElists the devices it depends on by name (by default dmsetup printsmajor:minorpairs).- In sysfs,
ls /sys/block/dm-0/slaves/lists the devices underdm-0, andls /sys/block/sda/sda2/holders/lists the dm devices built onsda2. - For LVM,
sudo lvs -a -o +devicesadds a column with the physical volumes each logical volume uses (Red Hat uses this in its LVM guide). - For multipath,
sudo multipath -lllists each multipath device with its WWID, itsdm-Nand thesdXpaths 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/fstabuse the/dev/mapperor/dev/VG/LVname, or a filesystem UUID, never/dev/dm-N. - Remove dm devices with the tool that made them (
lvchange -an,cryptsetup close,multipath -f), not withdmsetup 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.