Storage · Linux Storage
device-mapper
Cheat sheet · https://pcornel.dk/topic.php?topic=4003
Answer
Device-mapper is the Linux kernel framework that creates virtual block devices from other devices. LVM, dm-crypt (LUKS), dm-multipath and thin provisioning are all built on it; inspect with dmsetup.
Remember
- dm devices appear as /dev/dm-N and /dev/mapper/name.
- dmsetup shows tables and dependencies.
- Stacking order matters for removal.
First checks
dmsetup ls --tree— dm stackdmsetup table— mappingsdmsetup status— target status
Commands
multipathlsblk
Verify in this order
dm target → mapping → underlying devices
Where it usually breaks
First mismatch in provider/pool → virtual/logical disk → host/guest mapping → partition/filesystem → mount/drive → workload; preserve identity/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4003