3 .TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"
5 dmsetup \- low level logical volume management
12 .I device_name [-u uuid] [--notable | --table <table> | table_file]
15 .I [-f|--force] device_name
21 .I [--nolockfs] [--noflush] device_name
27 .I device_name [--table <table> | table_file]
33 .I device_name [--table <table> | table_file]
36 .I device_name new_name
39 .I device_name sector message
42 .I [--target target_type] [--exec command] [--tree [-o options]]
47 .B dmsetup info -c|-C|--columns
48 .I [--noheadings] [--separator separator] [-o fields] [-O|--sort sort_fields]
55 .I [--target target_type]
59 .I [--target target_type]
73 .B dmsetup setgeometry
74 .I device_name cyl head sect start
84 dmsetup manages logical devices that use the device-mapper driver.
85 Devices are created by loading a table that specifies a target for
86 each sector (512 bytes) in the logical device.
88 The first argument to dmsetup is a command.
89 The second argument is the logical device name or uuid.
91 Invoking the command as \fBdevmap_name\fP is equivalent to
93 \fBdmsetup info -c --noheadings -j \fImajor\fB -m \fIminor\fP.
95 .IP \fB-c|-C|--columns
97 Display output in columns rather than as Field: Value lines.
98 .IP \fB-j|--major\ \fImajor
100 Specify the major number.
101 .IP \fB-m|--minor\ \fIminor
103 Specify the minor number.
104 .IP \fB-n|--noheadings
106 Suppress the headings line when using columnar output.
109 Tell the kernel not to supply the open reference count for the device.
112 When creating a device, don't load any table.
115 Specify which fields to display.
118 Set the table being loaded read-only.
119 .IP \fB--readahead\ [+]<sectors>|auto|none
121 Specify read ahead size in units of sectors.
122 The default value is "auto" which allows the kernel to choose
123 a suitable value automatically. The + prefix lets you
124 specify a minimum value which will not be used if it is
125 smaller than the value chosen by the kernel.
126 "None" is equivalent to specifying zero.
127 .IP \fB--table\ <table>
129 Specify a one-line table directly on the command line.
133 .IP \fB-v|--verbose\ [-v|--verbose]
135 Produce additional output.
138 Display the library and kernel driver version.
141 .I device_name [-u uuid] [--notable | --table <table> | table_file]
143 Creates a device with the given name.
144 If table_file or <table> is supplied, the table is loaded and made live.
145 Otherwise a table is read from standard input unless --notable is used.
146 The optional uuid can be used in place of
147 device_name in subsequent dmsetup commands.
148 If successful a device will appear as
149 /dev/device-mapper/<device-name>.
150 See below for information on the table format.
154 Outputs a list of (major, minor) pairs for devices referenced by the
155 live table for the specified device.
159 Outputs a summary of the commands available, optionally including
160 the list of report fields.
164 Outputs some brief information about the device in the form:
166 State: SUSPENDED|ACTIVE, READ-ONLY
168 Tables present: LIVE and/or INACTIVE
172 Last event sequence number (used by \fBwait\fP)
174 Major and minor device number
176 Number of targets in the live table
179 .IP \fBinfo -c|-C|--columns
180 .I [--noheadings] [--separator separator] [-o fields] [-O|--sort sort_fields]
183 Output you can customise.
184 Fields are comma-separated and chosen from the following list:
185 name, major, minor, attr, open, segments, events, uuid.
186 Attributes are: (L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.
187 Precede the list with '+' to append
188 to the default selection of columns instead of replacing it.
189 Precede any sort_field with - for a reverse sort on that column.
191 .I [--target target_type]
193 .I [--tree [-o options]]
195 List device names. Optionally only list devices that have at least
196 one target of the specified type. Optionally execute a command for
197 each device. The device name is appended to the supplied command.
198 --tree displays dependencies between devices as a tree.
199 It accepts a comma-separate list of options.
200 Some specify the information displayed against each node:
201 device/nodevice; active, open, rw, uuid.
202 Others specify how the tree is displayed:
203 ascii, utf, vt100; compact, inverted, notrunc.
205 .I device_name [--table <table> | table_file]
207 Loads <table> or table_file into the inactive table slot for device_name.
208 If neither is supplied, reads a table from standard input.
210 .I device_name sector message
212 Send message to target. If sector not needed use 0.
216 Ensure that the node in /dev/mapper for device_name is correct.
217 If no device_name is supplied, ensure that all nodes in /dev/mapper
218 correspond to mapped devices currently loaded by the device-mapper kernel
219 driver, adding, changing or removing nodes as necessary.
221 .I [-f|--force] device_name
223 Removes a device. It will no longer be visible to dmsetup.
224 Open devices cannot be removed except with older kernels
225 that contain a version of device-mapper prior to 4.8.0.
226 In this case the device will be deleted when its open_count
227 drops to zero. From version 4.8.0 onwards, if a device can't
228 be removed because an uninterruptible process is waiting for
229 I/O to return from it, adding --force will replace the table
230 with one that fails all I/O, which might allow the
231 process to be killed.
235 Attempts to remove all device definitions i.e. reset the driver.
236 Use with care! From version 4.8.0 onwards, if devices can't
237 be removed because uninterruptible processess are waiting for
238 I/O to return from them, adding --force will replace the table
239 with one that fails all I/O, which might allow the
240 process to be killed. This also runs \fBmknodes\fP afterwards.
242 .I device_name new_name
248 Un-suspends a device.
249 If an inactive table has been loaded, it becomes live.
250 Postponed I/O then gets re-queued for processing.
252 .I device_name cyl head sect start
254 Sets the device geometry to C/H/S.
256 .I [--target target_type]
259 Outputs status information for each of the device's targets.
260 With --target, only information relating to the specified target type
263 .I [--nolockfs] [--noflush]
266 Suspends a device. Any I/O that has already been mapped by the device
267 but has not yet completed will be flushed. Any further I/O to that
268 device will be postponed for as long as the device is suspended.
269 If there's a filesystem on the device which supports the operation,
270 an attempt will be made to sync it first unless --nolockfs is specified.
271 Some targets such as recent (October 2006) versions of multipath may support
272 the --noflush option. This lets outstanding I/O that has not yet reached the
273 device to remain unflushed.
275 .I [--target target_type]
278 Outputs the current table for the device in a format that can be fed
279 back in using the create or load commands.
280 With --target, only information relating to the specified target type
284 Displays the names and versions of the currently-loaded targets.
287 Outputs version information.
292 Sleeps until the event counter for device_name exceeds event_nr.
293 Use -v to see the event number returned.
294 To wait until the next event is triggered, use \fBinfo\fP to find
295 the last event number.
297 Each line of the table specifies a single target and is of the form:
299 logical_start_sector num_sectors target_type target_args
303 There are currently three simple target types available together
304 with more complex optional ones that implement snapshots and mirrors.
307 .I destination_device start_sector
309 The traditional linear mapping.
312 .I num_stripes chunk_size [destination start_sector]+
314 Creates a striped area.
316 e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0
317 will map the first chunk (16k) as follows:
319 LV chunk 1 -> hda1, chunk 1
321 LV chunk 2 -> hdb1, chunk 1
323 LV chunk 3 -> hda1, chunk 2
325 LV chunk 4 -> hdb1, chunk 2
331 Errors any I/O that goes to this area. Useful for testing or
332 for creating devices with holes in them.
336 # A table to join two disks together
339 0 1028160 linear /dev/hda 0
341 1028160 3903762 linear /dev/hdb 0
344 # A table to stripe across the two disks,
346 # and add the spare space from
348 # hdb to the back of the volume
350 0 2056320 striped 2 32 /dev/hda 0 /dev/hdb 0
352 2056320 2875602 linear /dev/hdb 1028160
354 .SH ENVIRONMENT VARIABLES
357 The device directory name.
358 Defaults to "/dev" and must be an absolute path.
361 Original version: Joe Thornber (thornber@sistina.com)
364 Device-mapper resource page: http://sources.redhat.com/dm/