1 .TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"
3 dmsetup \- low level logical volume management
10 .I device_name [-u uuid] [--notable | --table <table> | table_file]
13 .I [-f|--force] device_name
19 .I [--nolockfs] [--noflush] device_name
25 .I device_name [--table <table> | table_file]
31 .I device_name [--table <table> | table_file]
34 .I device_name new_name
37 .I device_name sector message
40 .I [--target target_type] [--exec command] [--tree [-o options]]
45 .B dmsetup info -c|-C|--columns
46 .I [--noheadings] [--separator separator] [-o fields] [-O|--sort sort_fields]
53 .I [--target target_type]
57 .I [--target target_type]
70 .B dmsetup udevcomplete
73 .B dmsetup udevcomplete_all
75 .B dmsetup udevcookies
81 .B dmsetup setgeometry
82 .I device_name cyl head sect start
96 dmsetup manages logical devices that use the device-mapper driver.
97 Devices are created by loading a table that specifies a target for
98 each sector (512 bytes) in the logical device.
100 The first argument to dmsetup is a command.
101 The second argument is the logical device name or uuid.
103 Invoking the command as \fBdevmap_name\fP is equivalent to
105 \fBdmsetup info -c --noheadings -j \fImajor\fB -m \fIminor\fP.
107 .IP \fB-c|-C|--columns
109 Display output in columns rather than as Field: Value lines.
112 When returning any table information from the kernel report on the
113 inactive table instead of the live table.
114 Requires kernel driver version 4.16.0 or above.
115 .IP \fB-j|--major\ \fImajor
117 Specify the major number.
118 .IP \fB-m|--minor\ \fIminor
120 Specify the minor number.
121 .IP \fB-n|--noheadings
123 Suppress the headings line when using columnar output.
126 Tell the kernel not to supply the open reference count for the device.
129 When creating a device, don't load any table.
131 Do not synchronise with udev when creating, renaming or removing devices.
135 Specify which fields to display.
138 Set the table being loaded read-only.
139 .IP \fB--readahead\ [+]<sectors>|auto|none
141 Specify read ahead size in units of sectors.
142 The default value is "auto" which allows the kernel to choose
143 a suitable value automatically. The + prefix lets you
144 specify a minimum value which will not be used if it is
145 smaller than the value chosen by the kernel.
146 "None" is equivalent to specifying zero.
147 .IP \fB--table\ <table>
149 Specify a one-line table directly on the command line.
155 Answer yes to all prompts automatically.
156 .IP \fB-v|--verbose\ [-v|--verbose]
158 Produce additional output.
161 Display the library and kernel driver version.
164 .I device_name [-u uuid] [--notable | --table <table> | table_file]
166 Creates a device with the given name.
167 If table_file or <table> is supplied, the table is loaded and made live.
168 Otherwise a table is read from standard input unless --notable is used.
169 The optional uuid can be used in place of
170 device_name in subsequent dmsetup commands.
171 If successful a device will appear as
172 /dev/device-mapper/<device-name>.
173 See below for information on the table format.
177 Outputs a list of (major, minor) pairs for devices referenced by the
178 live table for the specified device.
182 Outputs a summary of the commands available, optionally including
183 the list of report fields.
187 Outputs some brief information about the device in the form:
189 State: SUSPENDED|ACTIVE, READ-ONLY
191 Tables present: LIVE and/or INACTIVE
195 Last event sequence number (used by \fBwait\fP)
197 Major and minor device number
199 Number of targets in the live table
202 .IP \fBinfo -c|-C|--columns
203 .I [--noheadings] [--separator separator] [-o fields] [-O|--sort sort_fields]
206 Output you can customise.
207 Fields are comma-separated and chosen from the following list:
208 name, major, minor, attr, open, segments, events, uuid.
209 Attributes are: (L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.
210 Precede the list with '+' to append
211 to the default selection of columns instead of replacing it.
212 Precede any sort_field with - for a reverse sort on that column.
214 .I [--target target_type]
216 .I [--tree [-o options]]
218 List device names. Optionally only list devices that have at least
219 one target of the specified type. Optionally execute a command for
220 each device. The device name is appended to the supplied command.
221 --tree displays dependencies between devices as a tree.
222 It accepts a comma-separate list of options.
223 Some specify the information displayed against each node:
224 device/nodevice; active, open, rw, uuid.
225 Others specify how the tree is displayed:
226 ascii, utf, vt100; compact, inverted, notrunc.
228 .I device_name [--table <table> | table_file]
230 Loads <table> or table_file into the inactive table slot for device_name.
231 If neither is supplied, reads a table from standard input.
233 .I device_name sector message
235 Send message to target. If sector not needed use 0.
239 Ensure that the node in /dev/mapper for device_name is correct.
240 If no device_name is supplied, ensure that all nodes in /dev/mapper
241 correspond to mapped devices currently loaded by the device-mapper kernel
242 driver, adding, changing or removing nodes as necessary.
244 .I [-f|--force] device_name
246 Removes a device. It will no longer be visible to dmsetup.
247 Open devices cannot be removed except with older kernels
248 that contain a version of device-mapper prior to 4.8.0.
249 In this case the device will be deleted when its open_count
250 drops to zero. From version 4.8.0 onwards, if a device can't
251 be removed because an uninterruptible process is waiting for
252 I/O to return from it, adding --force will replace the table
253 with one that fails all I/O, which might allow the
254 process to be killed.
258 Attempts to remove all device definitions i.e. reset the driver.
259 Use with care! From version 4.8.0 onwards, if devices can't
260 be removed because uninterruptible processes are waiting for
261 I/O to return from them, adding --force will replace the table
262 with one that fails all I/O, which might allow the
263 process to be killed. This also runs \fBmknodes\fP afterwards.
265 .I device_name new_name
271 Un-suspends a device.
272 If an inactive table has been loaded, it becomes live.
273 Postponed I/O then gets re-queued for processing.
275 .I device_name cyl head sect start
277 Sets the device geometry to C/H/S.
282 Splits given device name into subsystem constituents.
283 Default subsystem is LVM.
285 .I [--target target_type]
288 Outputs status information for each of the device's targets.
289 With --target, only information relating to the specified target type
292 .I [--nolockfs] [--noflush]
295 Suspends a device. Any I/O that has already been mapped by the device
296 but has not yet completed will be flushed. Any further I/O to that
297 device will be postponed for as long as the device is suspended.
298 If there's a filesystem on the device which supports the operation,
299 an attempt will be made to sync it first unless --nolockfs is specified.
300 Some targets such as recent (October 2006) versions of multipath may support
301 the --noflush option. This lets outstanding I/O that has not yet reached the
302 device to remain unflushed.
304 .I [--target target_type]
307 Outputs the current table for the device in a format that can be fed
308 back in using the create or load commands.
309 With --target, only information relating to the specified target type
313 Displays the names and versions of the currently-loaded targets.
318 Parses given cookie value and extracts any udev control flags encoded.
319 The output is in environment key format that is suitable for use in udev
320 rules. If the flag has its symbolic name assigned then the ouput is
321 DM_UDEV_FLAG_<flag_name>='1', DM_UDEV_FLAG<flag_position>='1' otherwise.
322 Subsystem udev flags don't have symbolic names assigned and these ones are
323 always reported as DM_SUBSYSTEM_UDEV_FLAG<flag_position>='1'. There are
324 16 udev flags altogether.
329 Wake any processes that are waiting for udev to complete processing the specified cookie.
331 .IP \fBudevcomplete_all
332 Remove all cookies. Any process waiting on a cookie will be resumed immediately.
335 List all existing cookies. Cookies are system-wide semaphores with keys
336 prefixed by two predefined bytes (0x0D4D).
340 Outputs version information.
345 Sleeps until the event counter for device_name exceeds event_nr.
346 Use -v to see the event number returned.
347 To wait until the next event is triggered, use \fBinfo\fP to find
348 the last event number.
350 Each line of the table specifies a single target and is of the form:
352 logical_start_sector num_sectors target_type target_args
356 There are currently three simple target types available together
357 with more complex optional ones that implement snapshots and mirrors.
360 .I destination_device start_sector
362 The traditional linear mapping.
365 .I num_stripes chunk_size [destination start_sector]+
367 Creates a striped area.
369 e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0
370 will map the first chunk (16k) as follows:
372 LV chunk 1 -> hda1, chunk 1
374 LV chunk 2 -> hdb1, chunk 1
376 LV chunk 3 -> hda1, chunk 2
378 LV chunk 4 -> hdb1, chunk 2
384 Errors any I/O that goes to this area. Useful for testing or
385 for creating devices with holes in them.
389 # A table to join two disks together
392 0 1028160 linear /dev/hda 0
394 1028160 3903762 linear /dev/hdb 0
397 # A table to stripe across the two disks,
399 # and add the spare space from
401 # hdb to the back of the volume
403 0 2056320 striped 2 32 /dev/hda 0 /dev/hdb 0
405 2056320 2875602 linear /dev/hdb 1028160
407 .SH ENVIRONMENT VARIABLES
410 The device directory name.
411 Defaults to "/dev" and must be an absolute path.
414 Original version: Joe Thornber (thornber@sistina.com)
417 Device-mapper resource page: http://sources.redhat.com/dm/