dmsetup

device-mapper low-level administration

TLDR

List all device mapper devices
$ dmsetup ls
Show device status
$ dmsetup status [device_name]
Show detailed information
$ dmsetup info
Show device table
$ dmsetup table [device_name]
Create a device mapper target
$ dmsetup create [name] --table "[0 size linear /dev/sda 0]"
Remove a device
$ dmsetup remove [device_name]
Suspend a device
$ dmsetup suspend [device_name]

SYNOPSIS

dmsetup command [options] [devicename_]

DESCRIPTION

dmsetup is the low-level administration tool for the Linux device-mapper. Device-mapper provides a generic way to create virtual block devices that map onto physical devices through various target types.The tool can create, configure, and manage device-mapper devices including linear mappings, striped volumes, snapshots, mirrors, and more. It's the foundation underlying LVM, dm-crypt, and other Linux storage technologies.While typically used indirectly through LVM or cryptsetup, dmsetup provides direct access for debugging, custom configurations, or understanding device-mapper internals.

PARAMETERS

COMMAND

Operation: ls, status, info, table, create, remove, etc.
ls
List device mapper devices.
status [DEVICE]
Show device status.
info [DEVICE]
Show detailed information.
table [DEVICE]
Show device table.
create NAME
Create new device.
remove DEVICE
Remove device.
suspend/resume DEVICE
Suspend/resume device.
--table TABLE
Device table specification.

INSTALL

sudo apt install dmsetup
sudo dnf install device-mapper
sudo pacman -S device-mapper
sudo apk add device-mapper
sudo zypper install device-mapper
brew install device-mapper

CAVEATS

Requires root privileges. Incorrect use can cause data loss. Tables must specify valid targets and parameters. Some operations require suspended devices.

HISTORY

dmsetup is part of the device-mapper component of LVM2, developed primarily by Red Hat and Sistina Software. Device-mapper was merged into the Linux kernel in 2003, providing the foundation for flexible storage management.

SEE ALSO

lvm(8), cryptsetup(8), dmraid(8)

RESOURCES

Source code · Homepage