mirror of
git://sourceware.org/git/lvm2.git
synced 2025-11-30 04:23:48 +03:00
- cmirrord.8_main: Remove unnecessary article 'the' before 'corosync' - dmsetup.8_main: Fix multiple grammar and punctuation issues * Add missing 'to' in 'Set this to zero to continue' * Fix 'eg,' -> 'e.g.,' and add missing comma * Add missing 'the' in 'for the live device' * Fix 'customised by following options' -> 'customised by the following options' * Fix 'comma-separate' -> 'comma-separated' - fsadm.8_main: Improve sentence structure for dm-crypt description - lvm.8_main: Fix capitalization 'volume Groups' -> 'Volume Groups' - lvm_import_vdo.8_main: Fix header title and multiple grammar issues * Fix header title 'FSADM' -> 'LVM_IMPORT_VDO' * Fix 'LV a backend device' -> 'LV as a backend device' * Fix 'the of volume group' -> 'the name of the volume group' * Remove extra 'with' in 'with within volume group' - lvmsystemid.7_main: Fix punctuation 'e.g.' -> 'e.g.,' and 'i.e.' -> 'i.e.,' These changes improve grammatical correctness, consistency, and readability. Originated-by: Cursor AI
1265 lines
28 KiB
Plaintext
1265 lines
28 KiB
Plaintext
.TH DMSETUP 8 "Mar 26 2025" Linux "MAINTENANCE COMMANDS"
|
|
.
|
|
.if !dEX \{\
|
|
.de EX
|
|
.nf
|
|
..
|
|
.de EE
|
|
.fi
|
|
..
|
|
\}
|
|
.
|
|
.\" So use .SY only for graphical rendering (postscript/pdf)
|
|
.\" and keep using .TP for ascii renderers
|
|
.de NSY
|
|
. ie t .SY \\$1
|
|
. el \{\
|
|
. ie \\n(.$>1 \{\
|
|
. PD 0
|
|
. TP \\w'\\$1\ 'u
|
|
. \}
|
|
. el .TP
|
|
. B \\$1
|
|
. na
|
|
. nh
|
|
.\}
|
|
..
|
|
.
|
|
.\" Use .SY for command synopsis
|
|
.de _NSY
|
|
. SY \\$1
|
|
..
|
|
.de CMS
|
|
. na
|
|
. nh
|
|
..
|
|
.
|
|
.ds CBR \&
|
|
.
|
|
.de CME
|
|
. hy
|
|
. ad
|
|
\\*[CBR]
|
|
..
|
|
.
|
|
.\" Still prefer .HP as it gives slightly better look
|
|
.\" for man pages rendered in text terminal.
|
|
.\" With .TP html rendering would likely also need .sp
|
|
.de NTP
|
|
.\". sp
|
|
. ie t .HP
|
|
. el .HP
|
|
..
|
|
.
|
|
.\" Use instead of plain .sh as some html renderers
|
|
.\" are simply misaligning otherwise
|
|
.de NSP
|
|
. br
|
|
\&
|
|
. br
|
|
..
|
|
.
|
|
.\" avoid hyphenation of these keywords
|
|
.hw dmsetup
|
|
.
|
|
.SH NAME
|
|
.
|
|
dmsetup \(em low level logical volume management
|
|
.
|
|
.SH SYNOPSIS
|
|
.
|
|
.NSY dmsetup 1
|
|
.de CMD_CLEAR
|
|
. CMS
|
|
. BR clear " "\c
|
|
. IR device_name \&
|
|
. CME
|
|
..
|
|
.CMD_CLEAR
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_CREATE
|
|
. CMS
|
|
. BR create " "\c
|
|
. IR device_name " "\c
|
|
. RB [ -n | --notable |\: --table\ \c
|
|
. IR table |\: table_file ] " "\c
|
|
. RB [ --readahead " [" + ]\c
|
|
. IR sectors |\:\c
|
|
. BR auto | none ] " "\c
|
|
. RB [ -u | --uuid\ \c
|
|
. IR uuid ] " "\c
|
|
. RB [ --addnodeoncreate |\: --addnodeonresume ]
|
|
. B \& \" Mask '-T html' rendering bug
|
|
. CME
|
|
..
|
|
.CMD_CREATE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_CREATE_CONCISE
|
|
. CMS
|
|
. BR create \ --concise " "\c
|
|
. RI [ concise_de\%vice_spe\%cification ] " "\c
|
|
. B \&
|
|
. CME
|
|
..
|
|
.CMD_CREATE_CONCISE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_DEPS
|
|
. CMS
|
|
. BR deps " "\c
|
|
. RB [ -o\ \c
|
|
. IR options ] " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_DEPS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_HELP
|
|
. CMS
|
|
. BR help " "\c
|
|
. RB [ -c | -C | --columns ]
|
|
. CME
|
|
..
|
|
.CMD_HELP
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_INFO
|
|
. CMS
|
|
. BR info " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_INFO
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_INFOLONG
|
|
. CMS
|
|
. BR info " "\c
|
|
. BR -c | -C | --columns " "\c
|
|
. RB [ --count\ \c
|
|
. IR count ] " "\c
|
|
. RB [ --interval\ \c
|
|
. IR seconds ] " "\c
|
|
. RB [ --noheadings |\: --headings\ \c
|
|
. BR none | abbrev |\: full |\: 0 | 1 | 2 ] " "\c
|
|
. RB [ -o\ \c
|
|
. IR fields ] " "\c
|
|
. RB [ -O | --sort\ \c
|
|
. IR sort_fields ] " "\c
|
|
. RB [ --nameprefixes ] " "\c
|
|
. RB [ --separator\ \c
|
|
. IR separator ] " "\c
|
|
. RI [ device_name ]
|
|
. CME
|
|
..
|
|
.CMD_INFOLONG
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_LOAD
|
|
. CMS
|
|
. BR load " "\c
|
|
. IR device_name " "\c
|
|
. RB [ --table\ \c
|
|
. IR table |\: table_file ]
|
|
. CME
|
|
..
|
|
.CMD_LOAD
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_LS
|
|
. CMS
|
|
. BR ls " "\c
|
|
. RB [ --target\ \c
|
|
. IR target_type ] " "\c
|
|
. RB [ -o\ \c
|
|
. IR options ] " "\c
|
|
. RB [ --exec\ \c
|
|
. IR command ] " "\c
|
|
. RB [ --tree ]
|
|
. CME
|
|
..
|
|
.CMD_LS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_MANGLE
|
|
. CMS
|
|
. BR mangle " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_MANGLE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_MEASURE
|
|
. CMS
|
|
. BR measure " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_MEASURE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_MESSAGE
|
|
. CMS
|
|
. BR message " "\c
|
|
. IR device_name " " sector " " message
|
|
. CME
|
|
..
|
|
.CMD_MESSAGE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_MKNODES
|
|
. CMS
|
|
. BR mknodes " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_MKNODES
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_RELOAD
|
|
. CMS
|
|
. BR reload " "\c
|
|
. IR device_name " "\c
|
|
. RB [ --table\ \c
|
|
. IR table |\: table_file ]
|
|
. CME
|
|
..
|
|
.CMD_RELOAD
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_REMOVE
|
|
. CMS
|
|
. BR remove " "\c
|
|
. RB [ -f | --force ] " "\c
|
|
. RB [ --retry ] " "\c
|
|
. RB [ --deferred ] " "\c
|
|
. IR device_name \ .\|.\|.\&
|
|
. CME
|
|
..
|
|
.CMD_REMOVE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_REMOVE_ALL
|
|
. CMS
|
|
. BR remove_all " "\c
|
|
. RB [ -f | --force ] " "\c
|
|
. RB [ --deferred ]
|
|
. CME
|
|
..
|
|
.CMD_REMOVE_ALL
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_RENAME
|
|
. CMS
|
|
. BR rename " "\c
|
|
. IR device_name " " new_name
|
|
. CME
|
|
..
|
|
.CMD_RENAME
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_RENAME_UUID
|
|
. CMS
|
|
. BR rename " "\c
|
|
. IR device_name " "\c
|
|
. BR --setuuid \ \c
|
|
. IR uuid \&
|
|
. CME
|
|
..
|
|
.CMD_RENAME_UUID
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_RESUME
|
|
. CMS
|
|
. BR resume " "\c
|
|
. IR device_name \ .\|.\|.\& " "\c
|
|
. RB [ --addnodeoncreate |\: --addnodeonresume ] " "\c
|
|
. RB [ --noflush ] " "\c
|
|
. RB [ --nolockfs ] " "\c
|
|
. RB [ --readahead\ \c
|
|
. RB [ + ]\c
|
|
. IR sec\%tors |\:\c
|
|
. BR auto | none ]
|
|
. CME
|
|
..
|
|
.CMD_RESUME
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_SETGEOMETRY
|
|
. CMS
|
|
. BR setgeometry " "\c
|
|
. IR device_name " " cyl " " head " " sect " " start
|
|
. CME
|
|
..
|
|
.CMD_SETGEOMETRY
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_SPLITNAME
|
|
. CMS
|
|
. BR splitname " "\c
|
|
. IR device_name " "\c
|
|
. RI [ subsystem ]
|
|
. CME
|
|
..
|
|
.CMD_SPLITNAME
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_STATS
|
|
. CMS
|
|
. BR stats " "\c
|
|
. IR command " [" options ]
|
|
. CME
|
|
..
|
|
.CMD_STATS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_STATUS
|
|
. CMS
|
|
. BR status " "\c
|
|
. RB [ --target\ \c
|
|
. IR target_type ] " "\c
|
|
. RB [ --noflush ] " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. CME
|
|
..
|
|
.CMD_STATUS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_SUSPEND
|
|
. CMS
|
|
. BR suspend " "\c
|
|
. IR device_name \ .\|.\|.\& " "\c
|
|
. RB [ --nolockfs ] " "\c
|
|
. RB [ --noflush ]
|
|
. CME
|
|
..
|
|
.CMD_SUSPEND
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_TABLE
|
|
. CMS
|
|
. BR table " "\c
|
|
. RB [ --concise ] " "\c
|
|
. RB [ --target\ \c
|
|
. IR target_type ] " "\c
|
|
. RB [ --showkeys ] " "\c
|
|
. RI [ device_name \ .\|.\|.]
|
|
. B \&
|
|
. CME
|
|
..
|
|
.CMD_TABLE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_TARGETS
|
|
. CMS
|
|
. B targets
|
|
. CME
|
|
..
|
|
.CMD_TARGETS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVCOMPLETE
|
|
. CMS
|
|
. BR udevcomplete " "\c
|
|
. IR cookie \&
|
|
. CME
|
|
..
|
|
.CMD_UDEVCOMPLETE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVCOMPLETE_ALL
|
|
. CMS
|
|
. BR udevcomplete_all " "\c
|
|
. RI [ age_in_minutes ]
|
|
. CME
|
|
..
|
|
.CMD_UDEVCOMPLETE_ALL
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVCOOKIES
|
|
. CMS
|
|
. B udevcookie
|
|
. CME
|
|
..
|
|
.CMD_UDEVCOOKIES
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVCREATECOOKIE
|
|
. CMS
|
|
. B udevcreatecookie
|
|
. CME
|
|
..
|
|
.CMD_UDEVCREATECOOKIE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVFLAGS
|
|
. CMS
|
|
. BR udevflags " "\c
|
|
. IR cookie \&
|
|
. CME
|
|
..
|
|
.CMD_UDEVFLAGS
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_UDEVRELEASECOOKIE
|
|
. CMS
|
|
. BR udevreleasecookie " "\c
|
|
. RI [ cookie ]
|
|
. CME
|
|
..
|
|
.CMD_UDEVRELEASECOOKIE
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_VERSION
|
|
. CMS
|
|
. B version
|
|
. CME
|
|
..
|
|
.CMD_VERSION
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_WAIT
|
|
. CMS
|
|
. BR wait " "\c
|
|
. IR device_name " "\c
|
|
. RB [ --noflush ] " "\c
|
|
. RI [ event_nr ]
|
|
. CME
|
|
..
|
|
.CMD_WAIT
|
|
.
|
|
.NSY dmsetup
|
|
.de CMD_WIPE_TABLE
|
|
. CMS
|
|
. BR wipe_table " "\c
|
|
. IR device_name \ .\|.\|.\& " "\c
|
|
. RB [ -f | --force ] " "\c
|
|
. RB [ --noflush ] " "\c
|
|
. RB [ --nolockfs ]
|
|
. CME
|
|
..
|
|
.CMD_WIPE_TABLE
|
|
.
|
|
.PD
|
|
.
|
|
.P
|
|
.B devmap_name
|
|
.I major minor
|
|
.br
|
|
.
|
|
.B devmap_name
|
|
.IR major : minor
|
|
.
|
|
.ad
|
|
.hy
|
|
.
|
|
.SH DESCRIPTION
|
|
.
|
|
dmsetup manages logical devices that use the device-mapper driver.
|
|
Devices are created by loading a table that specifies a target for
|
|
each sector (512 bytes) in the logical device.
|
|
.P
|
|
The first argument to dmsetup is a command.
|
|
The second argument is the logical device name or uuid.
|
|
.P
|
|
Invoking the dmsetup tool as \fBdevmap_name\fP
|
|
(which is not normally distributed and is supported
|
|
only for historical reasons) is equivalent to
|
|
.na
|
|
.BI "dmsetup info -c --noheadings -j " major " -m " minor .
|
|
.ad
|
|
.
|
|
.SH OPTIONS
|
|
.
|
|
.TP
|
|
.B --addnodeoncreate
|
|
Ensure \fI/dev/mapper\fP node exists after \fBdmsetup create\fP.
|
|
.
|
|
.TP
|
|
.B --addnodeonresume
|
|
Ensure \fI/dev/mapper\fP node exists after \fBdmsetup\ resume\fP
|
|
(default with udev).
|
|
.
|
|
.TP
|
|
.B --checks
|
|
Perform additional checks on the operations requested and report
|
|
potential problems. Useful when debugging scripts.
|
|
In some cases these checks may slow down operations noticeably.
|
|
.
|
|
.TP
|
|
.BR -c | -C | --columns
|
|
Display output in columns rather than as Field: Value lines.
|
|
.
|
|
.TP
|
|
\fB--count\fP \fIcount\fP
|
|
Specify the number of times to repeat a report.
|
|
Set this to zero to continue until interrupted.
|
|
The default interval is one second.
|
|
.
|
|
.TP
|
|
.BR -f | --force
|
|
Try harder to complete operation.
|
|
.
|
|
.TP
|
|
.BR -h | --help
|
|
Outputs a summary of the commands available, optionally including
|
|
the list of report fields (synonym with \fBhelp\fP command).
|
|
.
|
|
.TP
|
|
.B --inactive
|
|
When returning any table information from the kernel report
|
|
on the inactive table instead of the live table.
|
|
Requires kernel driver version 4.16.0 or above.
|
|
.
|
|
.TP
|
|
\fB--interval\fP \fIseconds\fP
|
|
Specify the interval in seconds between successive iterations for
|
|
repeating reports.
|
|
If \fB--interval\fP is specified but \fB--count\fP is not,
|
|
reports will continue to repeat until interrupted.
|
|
The default interval is one second.
|
|
.
|
|
.TP
|
|
.BR --manglename " " auto | hex | none
|
|
Mangle any character not on a whitelist using mangling_mode when
|
|
processing device-mapper device names and UUIDs. The names and UUIDs
|
|
are mangled on input and unmangled on output where the mangling mode
|
|
is one of:
|
|
\fBauto\fP (only do the mangling if not mangled yet,
|
|
do nothing if already mangled, error on mixed),
|
|
\fBhex\fP (always do the mangling) and
|
|
\fBnone\fP (no mangling).
|
|
Default mode is \fB#DEFAULT_MANGLING#\fP.
|
|
Character whitelist:
|
|
.BR 0 \(en 9 ,
|
|
.BR A \(en Z ,
|
|
.BR a \(en z ,
|
|
.BR #+\-.:=@_ .
|
|
This whitelist is also supported by udev.
|
|
Any character not on a whitelist is replaced
|
|
with its hex value (two digits) prefixed by \ex.
|
|
Mangling mode could be also set through
|
|
.B DM_DEFAULT_NAME_MAN\%GLING_MODE
|
|
environment variable.
|
|
.
|
|
.TP
|
|
\fB-j\fP|\fB --major\fP \fImajor\fP
|
|
Specify the major number.
|
|
.
|
|
.TP
|
|
\fB-m\fP|\fB--minor\fP \fIminor\fP
|
|
Specify the minor number.
|
|
.
|
|
.TP
|
|
.BR -n | --notable
|
|
When creating a device, don't load any table.
|
|
.
|
|
.TP
|
|
.B --nameprefixes
|
|
Add a "DM_" prefix plus the field name to the output.
|
|
Useful with \fB--noheadings\fP to produce a list of field=value
|
|
pairs that can be used to set environment variables
|
|
(for example, in
|
|
.BR udev (7)
|
|
rules).
|
|
.
|
|
.TP
|
|
.B --noheadings
|
|
Suppress the headings line when using columnar output.
|
|
.
|
|
.TP
|
|
.BR --headings " " none |\: abbrev | full |\: 0 | 1 | 2
|
|
Type of headings line to use for columnar output.
|
|
.br
|
|
\fBnone\fP or \fB0\fP \(en No headings.
|
|
.br
|
|
\fBabbrev\fP or \fB1\fP \(en Column name abbreviations.
|
|
.br
|
|
\fBfull\fP or \fB2\fP \(en Full column names.
|
|
.
|
|
.TP
|
|
.B --noflush
|
|
Do not flush outstanding I/O when suspending a device, or do not
|
|
commit thin-pool metadata when obtaining thin-pool status.
|
|
.
|
|
.TP
|
|
.B --nolockfs
|
|
Do not attempt to synchronize filesystem, e.g., when suspending a device.
|
|
.
|
|
.TP
|
|
.B --noopencount
|
|
Tell the kernel not to supply the open reference count for the device.
|
|
.
|
|
.TP
|
|
.B --noudevrules
|
|
Do not allow udev to manage nodes for devices in device-mapper directory.
|
|
.
|
|
.TP
|
|
.B --noudevsync
|
|
Do not synchronize with udev when creating, renaming or removing devices.
|
|
.
|
|
.TP
|
|
\fB-o\fP|\fB--options\fP \fIoptions\fP
|
|
Specify which fields to display.
|
|
.
|
|
.TP
|
|
\fB--readahead\fP [\fB+\fP]\fIsectors\fP|\:\fBauto\fP|\:\fBnone\fP
|
|
Specify read ahead size in units of sectors.
|
|
The default value is \fBauto\fP which allows the kernel to choose
|
|
a suitable value automatically.
|
|
The \fB+\fP prefix lets you specify a minimum value which will
|
|
not be used if it is smaller than the value chosen by the kernel.
|
|
The value \fBnone\fP is equivalent to specifying zero.
|
|
.
|
|
.TP
|
|
.BR -r | --readonly
|
|
Set the table being loaded read-only.
|
|
.
|
|
.TP
|
|
\fB-S\fP|\fB--select\fP \fIselection\fP
|
|
Process only items that match \fIselection\fP criteria.
|
|
If the command is producing report output,
|
|
adding the "selected" column (\fB-o selected\fP) displays all rows
|
|
and shows 1 if the row matches the \fIselection\fP and 0 otherwise.
|
|
The selection criteria are defined by specifying column names
|
|
and their valid values while making use of supported comparison operators.
|
|
As a quick help and to see full list of column names that can be used
|
|
in selection and the set of supported selection operators,
|
|
check the output of
|
|
.na
|
|
.nh
|
|
.B dmsetup info -c -S help
|
|
.hy
|
|
.ad
|
|
command.
|
|
.
|
|
.TP
|
|
\fB--table\fP \fItable\fP
|
|
Specify a one-line table directly on the command line.
|
|
See below for more information on the table format.
|
|
.
|
|
.TP
|
|
\fB--udevcookie\fP \fIcookie\fP
|
|
Use cookie for udev synchronization.
|
|
.br
|
|
Note: Same cookie should be used for same type of operations
|
|
i.e.\& creation of multiple different devices.
|
|
It's not advised to combine different operations on the single device.
|
|
.
|
|
.TP
|
|
\fB-u\fP|\fB--uuid\fP \fIuuid\fP
|
|
Specify the \fIuuid\fP.
|
|
.
|
|
.TP
|
|
.BR -y | --yes
|
|
Answer yes to all prompts automatically.
|
|
.
|
|
.TP
|
|
.BR -v | --verbose " [" -v |\: --verbose ]
|
|
Produce additional output.
|
|
.
|
|
.TP
|
|
.B --verifyudev
|
|
If udev synchronization is enabled, verify that udev operations get performed
|
|
correctly and try to fix up the device nodes afterwards if not.
|
|
.
|
|
.TP
|
|
.B --version
|
|
Display the library and kernel driver version.
|
|
.
|
|
.SH COMMANDS
|
|
.ds CBR .br
|
|
.
|
|
.NTP
|
|
.CMD_CLEAR
|
|
Destroys the table in the inactive table slot for device_name.
|
|
.
|
|
.NTP
|
|
.CMD_CREATE
|
|
Creates a device with the given name.
|
|
If \fItable\fP or \fItable_file\fP is supplied,
|
|
the table is loaded and made live.
|
|
Otherwise a table is read from standard input unless \fB--notable\fP is used.
|
|
The optional \fIuuid\fP can be used in place of
|
|
device_name in subsequent dmsetup commands.
|
|
If successful the device will appear in table and for the live
|
|
device the node
|
|
.na
|
|
.I /dev/mapper/device_name
|
|
is created.
|
|
See below for more information on the table format.
|
|
.ad
|
|
.
|
|
.NTP
|
|
.CMD_CREATE_CONCISE
|
|
Creates one or more devices from a concise device specification.
|
|
Each device is specified by a comma-separated list:
|
|
.IR name ", " uuid ", " "minor number" ", " flags ,
|
|
.IR "comma-separated table lines" .
|
|
Flags defaults to read-write (rw) or may be read-only (ro).
|
|
Uuid, minor number and flags are optional so those fields may be empty.
|
|
A semi-colon separates specifications of different devices.
|
|
Use a backslash to escape the following character,
|
|
for example a comma or semi-colon in a name or table.
|
|
See also
|
|
.B CONCISE FORMAT
|
|
below.
|
|
.
|
|
.NTP
|
|
.CMD_DEPS
|
|
Outputs a list of devices referenced by the live table for the specified
|
|
device. Device names on output can be customised by the following options:
|
|
\fBdevno\fP (major and minor pair, used by default),
|
|
\fBblkdevname\fP (block device name),
|
|
\fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
|
|
.
|
|
.NTP
|
|
.CMD_HELP
|
|
Outputs a summary of the commands available, optionally including
|
|
the list of report fields.
|
|
.
|
|
.NTP
|
|
.CMD_INFO
|
|
Outputs some brief information about the device in the form:
|
|
.RS
|
|
.RS
|
|
.na
|
|
.nh
|
|
State: SUSPENDED|\:ACTIVE, READ-ONLY
|
|
.br
|
|
Read Ahead: sectors
|
|
.br
|
|
Tables present: LIVE and/or INACTIVE
|
|
.br
|
|
Open reference count
|
|
.br
|
|
Last event sequence number (used by \fBwait\fP)
|
|
.br
|
|
Major and minor device number
|
|
.br
|
|
Number of targets in the live table
|
|
.br
|
|
UUID
|
|
.RE
|
|
.RE
|
|
.
|
|
.NTP
|
|
.CMD_INFOLONG
|
|
Output you can customise.
|
|
Fields are comma-separated and chosen from the following list:
|
|
.BR name ,
|
|
.BR major ,
|
|
.BR minor ,
|
|
.BR attr ,
|
|
.BR open ,
|
|
.BR segments ,
|
|
.BR events ,
|
|
.BR uuid .
|
|
Attributes are:
|
|
.RB ( L )ive,
|
|
.RB ( I )nactive,
|
|
.RB ( s )uspended,
|
|
.RB ( r )ead-only,
|
|
.RB read-( w )rite.
|
|
Precede the list with '\fB+\fP' to append
|
|
to the default selection of columns instead of replacing it.
|
|
Precede any sort field with '\fB-\fP' for a reverse sort on that column.
|
|
.
|
|
.NTP
|
|
.CMD_LS
|
|
List device names. Optionally only list devices that have at least
|
|
one target of the specified type. Optionally execute a command for
|
|
each device. The device name is appended to the supplied command.
|
|
Device names on output can be customised by the following options:
|
|
\fBdevno\fP (major and minor pair, used by default),
|
|
\fBblkdevname\fP (block device name),
|
|
\fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
|
|
\fB--tree\fP displays dependencies between devices as a tree.
|
|
It accepts a comma-separated list of options.
|
|
Some specify the information displayed against each node:
|
|
.BR device\ /\: \ nodevice ;
|
|
.BR blkdevname ;
|
|
.BR active ,
|
|
.BR open ,
|
|
.BR rw ,
|
|
.BR uuid .
|
|
Others specify how the tree is displayed:
|
|
.BR ascii ,
|
|
.BR utf ,
|
|
.BR vt100 ;
|
|
.BR compact ,
|
|
.BR inverted ,
|
|
.BR notrunc .
|
|
.
|
|
.NTP
|
|
.CMD_RELOAD
|
|
Loads \fItable\fP or \fItable_file\fP
|
|
into the inactive table slot for device_name.
|
|
If neither is supplied, reads a table from standard input.
|
|
.
|
|
.NTP
|
|
.CMD_MANGLE
|
|
Ensure existing device-mapper \fIdevice_name\fP and UUID is in the correct
|
|
mangled form containing only whitelisted characters (supported by udev)
|
|
and do a rename if necessary.
|
|
Any character not on the whitelist will be mangled based on
|
|
the \fB--manglename\fP setting. Automatic rename works only for device
|
|
names and not for device UUIDs because the kernel does not allow changing
|
|
the UUID of active devices. Any incorrect UUIDs are reported only and they
|
|
must be manually corrected by deactivating the device first and then
|
|
reactivating it with proper mangling mode used (see also \fB--manglename\fP).
|
|
.
|
|
.NTP
|
|
.CMD_MEASURE
|
|
Show the data that \fIdevice_name\fP would report to the IMA subsystem
|
|
if a measurement was triggered at the current time.
|
|
This is for debugging and does not actually trigger a measurement.
|
|
.
|
|
.NTP
|
|
.CMD_MESSAGE
|
|
Send message to target. If sector not needed use 0.
|
|
.
|
|
.NTP
|
|
.CMD_MKNODES
|
|
Ensure that the node in \fI/dev/mapper\fP for \fIdevice_name\fP is correct.
|
|
If no device_name is supplied, ensure that all nodes in \fI/dev/mapper\fP
|
|
correspond to mapped devices currently loaded by the device-mapper kernel
|
|
driver, adding, changing or removing nodes as necessary.
|
|
.
|
|
.NTP
|
|
.CMD_REMOVE
|
|
Removes a device.
|
|
It will no longer be visible to dmsetup.
|
|
Open devices cannot be removed, but adding \fB--force\fP
|
|
will replace the table with one that fails all I/O.
|
|
\fB--deferred\fP will enable deferred removal of open devices -
|
|
the device will be removed when the last user closes it.
|
|
The deferred removal feature is supported since version 4.27.0
|
|
of the device-mapper driver available in upstream kernel version 3.13.
|
|
(Use \fBdmsetup version\fP to check this.)
|
|
If an attempt to remove a device fails, perhaps because a process run
|
|
from a quick udev rule temporarily opened the device,
|
|
the \fB--retry\fP option will cause the operation to be retried
|
|
for a few seconds before failing.
|
|
Do NOT combine \fB--force\fP and \fB--udevcookie\fP,
|
|
as udev may start to process udev rules in the middle of error target
|
|
replacement and result in nondeterministic result.
|
|
.
|
|
.NTP
|
|
.CMD_REMOVE_ALL
|
|
Attempts to remove all device definitions i.e.\& reset the driver.
|
|
This also runs \fBmknodes\fP afterwards.
|
|
Use with care!
|
|
Open devices cannot be removed, but adding \fB--force\fP
|
|
will replace the table with one that fails all I/O.
|
|
\fB--deferred\fP will enable deferred removal of open devices -
|
|
the device will be removed when the last user closes it.
|
|
The deferred removal feature is supported since version 4.27.0
|
|
of the device-mapper driver available in upstream kernel version 3.13.
|
|
.
|
|
.NTP
|
|
.CMD_RENAME
|
|
Renames a device.
|
|
.
|
|
.NTP
|
|
.CMD_RENAME_UUID
|
|
Sets the uuid of a device that was created without a uuid.
|
|
After a uuid has been set it cannot be changed.
|
|
.
|
|
.NTP
|
|
.CMD_RESUME
|
|
Un-suspends a device.
|
|
If an inactive table has been loaded, it becomes live.
|
|
Postponed I/O then gets re-queued for processing.
|
|
.
|
|
.NTP
|
|
.CMD_SETGEOMETRY
|
|
Sets the device geometry to C/H/S.
|
|
.
|
|
.NTP
|
|
.CMD_SPLITNAME
|
|
Splits given \fIdevice name\fP into \fIsubsystem\fP constituents.
|
|
The default subsystem is LVM.
|
|
LVM currently generates device names by concatenating the names of the Volume
|
|
Group, Logical Volume and any internal Layer with a hyphen as separator.
|
|
Any hyphens within the names are doubled to escape them.
|
|
The precise encoding might change without notice in any future
|
|
release, so we recommend you always decode using the current version of
|
|
this command.
|
|
.
|
|
.NTP
|
|
.CMD_STATS
|
|
Manages IO statistics regions for devices.
|
|
See
|
|
.BR dmstats (8)
|
|
for more details.
|
|
.
|
|
.NTP
|
|
.CMD_STATUS
|
|
Outputs status information for each of the device's targets.
|
|
With \fB--target\fP, only information relating
|
|
to the specified target type any is displayed.
|
|
With \fB--noflush\fP, the thin target (from version 1.3.0)
|
|
doesn't commit any outstanding changes to disk
|
|
before reporting its statistics.
|
|
.
|
|
.NTP
|
|
.CMD_SUSPEND
|
|
Suspends a device. Any I/O that has already been mapped by the device
|
|
but has not yet completed will be flushed. Any further I/O to that
|
|
device will be postponed for as long as the device is suspended.
|
|
If there's a filesystem on the device which supports the operation,
|
|
an attempt will be made to sync it first unless \fB--nolockfs\fP is specified.
|
|
Some targets such as recent (October 2006) versions of multipath may support
|
|
the \fB--noflush\fP option. This lets outstanding I/O that has not yet
|
|
reached the device to remain unflushed.
|
|
.
|
|
.NTP
|
|
.CMD_TABLE
|
|
Outputs the current table for the device in a format that can be fed
|
|
back in using the create or load commands.
|
|
With \fB--target\fP, only information relating to the specified target type
|
|
is displayed.
|
|
Real encryption keys are suppressed in the table output for crypt and integrity
|
|
targets unless the \fB--showkeys\fP parameter is supplied. Kernel key
|
|
references prefixed with \fB:\fP are not affected by the parameter and get
|
|
displayed always (crypt target only).
|
|
With \fB--concise\fP, the output is presented concisely on a single line.
|
|
Commas then separate the name, uuid, minor device number, flags ('ro' or 'rw')
|
|
and the table (if present). Semi-colons separate devices.
|
|
Backslashes escape any commas, semi-colons or backslashes.
|
|
See
|
|
.B CONCISE FORMAT
|
|
below.
|
|
.
|
|
.NTP
|
|
.CMD_TARGETS
|
|
Displays the names and versions of the currently-loaded targets.
|
|
.
|
|
.NTP
|
|
.CMD_UDEVCOMPLETE
|
|
Wake any processes
|
|
that are waiting for udev to complete processing the specified cookie.
|
|
.
|
|
.NTP
|
|
.CMD_UDEVCOMPLETE_ALL
|
|
Remove all cookies older than the specified number of minutes.
|
|
Any process waiting on a cookie will be resumed immediately.
|
|
.
|
|
.NTP
|
|
.CMD_UDEVCOOKIES
|
|
List all existing cookies. Cookies are system-wide semaphores with keys
|
|
prefixed by two predefined bytes (0x0D4D).
|
|
.
|
|
.NTP
|
|
.CMD_UDEVCREATECOOKIE
|
|
Creates a new cookie to synchronize actions with udev processing.
|
|
The output is a cookie value. Normally we don't need to create cookies since
|
|
dmsetup creates and destroys them for each action automatically.
|
|
However, we can generate one explicitly to group several actions together
|
|
and use only one cookie instead.
|
|
We can define a cookie to use for each relevant command by using
|
|
\fB--udevcookie\fP option.
|
|
Alternatively, we can export this value into the environment
|
|
of the dmsetup process as \fBDM_UDEV_COOKIE\fP variable and it will be used
|
|
automatically with all subsequent commands until it is unset.
|
|
Invoking this command will create system-wide semaphore that needs to be cleaned
|
|
up explicitly by calling udevreleasecookie command.
|
|
.
|
|
.NTP
|
|
.CMD_UDEVFLAGS
|
|
Parses given \fIcookie\fP value and extracts any udev control flags encoded.
|
|
The output is in environment key format that is suitable for use in udev
|
|
rules. If the flag has its symbolic name assigned then the output is
|
|
.na
|
|
DM_UDEV_FLAG_\:<flag_\:name> =\ '1',
|
|
DM_UDEV_FLAG\:<flag_\:position> =\ '1'
|
|
.ad
|
|
otherwise.
|
|
Subsystem udev flags don't have symbolic names assigned and these ones are
|
|
always reported as
|
|
.na
|
|
DM_SUBSYSTEM_\:UDEV_\:FLAG\:<flag_\:position> =\ '1'.
|
|
.ad
|
|
There are 16 udev flags altogether.
|
|
.
|
|
.NTP
|
|
.CMD_UDEVRELEASECOOKIE
|
|
Waits for all pending udev processing bound to given cookie value and clean up
|
|
the cookie with underlying semaphore. If the cookie is not given directly,
|
|
the command will try to use a value defined by \fBDM_UDEV_COOKIE\fP
|
|
environment variable.
|
|
.
|
|
.NTP
|
|
.CMD_VERSION
|
|
Outputs version information.
|
|
.
|
|
.NTP
|
|
.CMD_WAIT
|
|
Sleeps until the event counter for device_name exceeds event_nr.
|
|
Use \fB-v\fP to see the event number returned.
|
|
To wait until the next event is triggered, use \fBinfo\fP to find
|
|
the last event number.
|
|
With \fB--noflush\fP, the thin target (from version 1.3.0) doesn't commit
|
|
any outstanding changes to disk before reporting its statistics.
|
|
.
|
|
.NTP
|
|
.CMD_WIPE_TABLE
|
|
Wait for any I/O in-flight through the device to complete, then
|
|
replace the table with a new table that fails any new I/O
|
|
sent to the device. If successful, this should release any devices
|
|
held open by the device's table(s).
|
|
.
|
|
.SH TABLE FORMAT
|
|
.
|
|
Each line of the table specifies a single target and is of the form:
|
|
.P
|
|
.shc \\
|
|
.na
|
|
.nh
|
|
.I \%logical_start_sector\%\ num_sectors\%\ \c
|
|
.B target_type\%\ \c
|
|
.I target_args
|
|
.hy
|
|
.ad
|
|
.shc
|
|
.
|
|
.sp
|
|
Simple target types and target args include:
|
|
.
|
|
.NTP
|
|
.CMS
|
|
\fBlinear\fP \fIdestination_device start_sector\fP
|
|
.CME
|
|
The traditional linear mapping.
|
|
.
|
|
.NTP
|
|
.CMS
|
|
\fBstriped\fP \fInum_stripes chunk_size\fP \
|
|
[\fIdestination start_sector\fP]\ .\|.\|.
|
|
.CME
|
|
Creates a striped area.
|
|
.br
|
|
.na
|
|
e.g.\& striped 2 32 /dev/hda1 0 /dev/hdb1 0
|
|
will map the first chunk (16\ KiB) as follows:
|
|
.RS
|
|
.RS
|
|
LV chunk 1 \[->] hda1, chunk 1
|
|
.br
|
|
LV chunk 2 \[->] hdb1, chunk 1
|
|
.br
|
|
LV chunk 3 \[->] hda1, chunk 2
|
|
.br
|
|
LV chunk 4 \[->] hdb1, chunk 2
|
|
.br
|
|
etc.
|
|
.RE
|
|
.RE
|
|
.na
|
|
.
|
|
.TP
|
|
.B error
|
|
Errors any I/O that goes to this area. Useful for testing or
|
|
for creating devices with holes in them.
|
|
.
|
|
.TP
|
|
.B zero
|
|
Returns blocks of zeroes on reads.
|
|
Any data written is discarded silently.
|
|
This is a block-device equivalent of the \fI/dev/zero\fP
|
|
character-device data sink described in \fBnull\fP(4).
|
|
.P
|
|
More complex targets include:
|
|
.
|
|
.TP
|
|
.B cache
|
|
Improves performance of a block device (e.g., a spindle) by dynamically
|
|
migrating some of its data to a faster smaller device (e.g., an SSD).
|
|
.
|
|
.TP
|
|
.B crypt
|
|
Transparent encryption of block devices using the kernel crypto API.
|
|
.
|
|
.TP
|
|
.B delay
|
|
Delays reads and/or writes to different devices.
|
|
Useful for testing.
|
|
.
|
|
.TP
|
|
.B flakey
|
|
Creates a similar mapping to the linear target
|
|
but exhibits unreliable behaviour periodically.
|
|
Useful for simulating failing devices when testing.
|
|
.
|
|
.TP
|
|
.B mirror
|
|
Mirrors data across two or more devices.
|
|
.
|
|
.TP
|
|
.B multipath
|
|
Mediates access through multiple paths to the same device.
|
|
.
|
|
.TP
|
|
.B raid
|
|
Offers an interface to the kernel's software raid driver, md.
|
|
.
|
|
.TP
|
|
.B snapshot
|
|
Supports snapshots of devices.
|
|
.
|
|
.TP
|
|
.BR thin ", " thin-pool
|
|
Supports thin provisioning of devices and also provides
|
|
a better snapshot support.
|
|
.P
|
|
To find out more about the various targets and their table formats
|
|
and status lines, please read the files in
|
|
the Documentation/device-mapper directory
|
|
in the kernel source tree.
|
|
(Your distribution might include a copy of this information in the
|
|
documentation directory for the device-mapper package.)
|
|
.
|
|
.SH EXAMPLES
|
|
.
|
|
.EX
|
|
# A table to join two disks together
|
|
0 1028160 linear /dev/hda 0
|
|
1028160 3903762 linear /dev/hdb 0
|
|
.sp
|
|
# A table to stripe across the two disks,
|
|
# and add the spare space from
|
|
# hdb to the back of the volume
|
|
0 2056320 striped 2 32 /dev/hda 0 /dev/hdb 0
|
|
2056320 2875602 linear /dev/hdb 1028160
|
|
.EE
|
|
.
|
|
.SH CONCISE FORMAT
|
|
.
|
|
A concise representation of one of more devices:
|
|
.
|
|
.PD 0
|
|
.
|
|
.IP \(bu 2
|
|
A comma separates the fields of each device.
|
|
.
|
|
.IP \(bu
|
|
A semi-colon separates devices.
|
|
.
|
|
.PD
|
|
.
|
|
.P
|
|
The representation of a device takes the form:
|
|
.RS
|
|
.shc \\
|
|
.na
|
|
.nh
|
|
.RI \%< name >,< uuid >,\%< minor >,< flags >,\%< table >\%\c
|
|
.RI [,< table >+]\%\c
|
|
.RI [;< name >,< uuid >,\%< minor >,< flags >,\%< table >\%\c
|
|
.RI [,< table >+]]
|
|
.hy
|
|
.ad
|
|
.shc
|
|
.RE
|
|
.
|
|
.P
|
|
The fields are:
|
|
.
|
|
.TP
|
|
.I name
|
|
The name of the device.
|
|
.
|
|
.TP
|
|
.I uuid
|
|
The UUID of the device (or empty).
|
|
.
|
|
.TP
|
|
.I minor
|
|
The minor number of the device.
|
|
If empty, the kernel assigns a suitable minor number.
|
|
.
|
|
.TP
|
|
.I flags
|
|
Supported flags are:
|
|
.
|
|
.PD 0
|
|
.RS
|
|
.
|
|
.TP 4
|
|
.B ro
|
|
Sets the table being loaded for the device read-only
|
|
.
|
|
.TP
|
|
.B rw
|
|
Sets the table being loaded for the device read-write (default)
|
|
.RE
|
|
.PD
|
|
.
|
|
.TP
|
|
.I table
|
|
One line of the table. See TABLE FORMAT above.
|
|
.
|
|
.SH EXAMPLES
|
|
.
|
|
.EX
|
|
# A simple linear read-only device
|
|
test-linear-small,,,ro,\\
|
|
\ 0 2097152 linear /dev/loop0\ 0,\\
|
|
\ 2097152 2097152 linear /dev/loop1 0
|
|
.sp
|
|
# Two linear devices
|
|
test-linear-small,,,,\\
|
|
\ 0 2097152 linear /dev/loop0 0;\\
|
|
\ test-linear-large,,,,\\
|
|
\ 0 2097152 linear /dev/loop1 0,\\
|
|
\ 2097152 2097152 linear /dev/loop2 0
|
|
.EE
|
|
.
|
|
.SH ENVIRONMENT VARIABLES
|
|
.
|
|
.TP
|
|
.B DM_DEV_DIR
|
|
The device directory name.
|
|
Defaults to "\fI/dev\fP" and must be an absolute path.
|
|
.
|
|
.TP
|
|
.B DM_UDEV_COOKIE
|
|
A cookie to use for all relevant commands to synchronize with udev processing.
|
|
It is an alternative to using \fB--udevcookie\fP option.
|
|
.
|
|
.TP
|
|
.B DM_DEFAULT_NAME_MANGLING_MODE
|
|
A default mangling mode.
|
|
Defaults to "\fB#DEFAULT_MANGLING#\fP"
|
|
and it is an alternative to using \fB--manglename\fP option.
|
|
.
|
|
.SH AUTHORS
|
|
.
|
|
.na
|
|
.nh
|
|
Original version:
|
|
.MT thornber@redhat.com
|
|
Joe Thornber
|
|
.ME
|
|
.
|
|
.SH SEE ALSO
|
|
.
|
|
.na
|
|
.nh
|
|
.BR dmstats (8),
|
|
.BR udev (7),
|
|
.BR udevadm (8)
|
|
.P
|
|
.UR https://\:www.sourceware.org/lvm2
|
|
LVM2 resource page:
|
|
.UE
|
|
.br
|
|
.UR https://\:www.sourceware.org/dm
|
|
Device-mapper resource page:
|
|
.UE
|