← 返回命令列表

Linux command

dmsetup 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List all device

dmsetup ls

Show device status

dmsetup status [device_name]

Show detailed information

dmsetup info

Show device table

dmsetup table [device_name]

Create a device

dmsetup create [name] --table "[0 size linear /dev/sda 0]"

Remove a device

dmsetup remove [device_name]

Suspend a device

dmsetup suspend [device_name]

说明

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.

参数

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.

FAQ

What is the dmsetup command used for?

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.

How do I run a basic dmsetup example?

Run `dmsetup ls` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does ls do in dmsetup?

List device mapper devices.