4 mdadm \- manage MD devices
10 .BI mdadm " [mode] <raiddevice> [options] <subdevices>"
13 RAID devices are virtual devices created from two or more
14 real block devices. This allows multiple devices (typically disk
15 drives or partitions there-of) to be combined into a single device to
16 hold (for example) a single filesystem.
17 Some RAID levels included redundancy and so can survive some degree of
20 Linux Software RAID devices are implemented through the md (Multiple Devices) device driver.
22 Currently, Linux supports
33 Recent kernels (2002) also support a mode known as
36 does not support MULTIPATH as yet.
39 is a program that can be used to create, manage, and monitor
41 such it provides a similar set of functionality to the
44 The key differences between
51 is a single program and not a collection of programs.
54 can perform (almost) all of its functions without having a
55 configuration file. Also mdadm helps with management of the configuration
59 can provide information about your arrays (through Detail and Examine)
65 can manage MULTIPATH devices which
70 mdadm has 7 major modes of operation:
73 Assemble the parts of a previously created
74 array into an active array. Components can be explicitly given
75 or can be searched for.
77 checks that the components
78 do form a bona fide array, and can, on request, fiddle superblock
79 information so as to assemble a faulty array.
83 Build a legacy array without per-device superblocks.
87 Create a new array with per-device superblocks.
89 '''in several step create-add-add-run or it can all happen with one command.
93 Display the details of a given md device. Details include the RAID
94 level, the number of devices, which ones are faulty (if any), and the
99 Examine a device to see if it is part of an md array, and print out
100 the details of that array.
101 This mode can also be used to examine a large number of devices and to
102 print out a summary of the arrays found in a format suitable for the
107 .B "Follow or Monitor"
108 Monitor one or more md devices and act on any state changes.
112 This is for odd bits an pieces like hotadd, hotremove, setfaulty, stop,
114 '''If an array is only partially setup by the
115 '''Create or Assemble commands, subsequent Manage commands can finish the
120 Available options are:
123 .BR -A ", " --assemble
124 Assemble an existing array.
128 Build a legacy array without superblocks.
136 Print detail of one or more md devices.
139 .BR -E ", " --examine
140 Print content of md superblock on device(s).
143 .BR -F ", " --follow ", " --monitor
150 Display help message or, after above option, mode specific help message.
153 .BR -V ", " --version
154 Print version information for mdadm.
157 .BR -v ", " --verbose
158 Be more verbose about what is happening.
162 Be less verbose. This is used with
167 .SH For create or build:
171 Specify chunk size of kibibytes. The default is 64.
175 Specify rounding factor for linear array (==chunk size)
179 Set raid level. Options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid5, 4,
180 raid5, 5. Obviously some of these are synonymous.
181 Only the first 4 are valid when Building.
184 .BR -p ", " --parity=
185 Set raid5 parity algorithm. Options are:
186 {left,right}-{,a}symmetric, la, ra, ls, rs. The default is left-symmetric.
193 .BR -n ", " --raid-disks=
194 number of active devices in array.
197 .BR -x ", " --spare-disks=
198 number of spare (eXtra) disks in initial array. Spares can be added
203 Amount (in Kibibytes) of space to use from each drive in RAID1/4/5.
204 This must be a multiple of the chunk size, and must leave about 128Kb
205 of space at the end of the drive for the RAID superblock.
206 If this is not specified
207 (as it normally is not) the smallest drive (or partition) sets the
208 size, though if there is a variance among the drives of greater than 1%, a warning is
215 uuid of array to assemble. Devices which don't have this uuid are
219 .BR -m ", " --super-minor=
220 Minor number of device that array was created for. Devices which
221 don't have this minor number are excluded. If you create an array as
222 /dev/md1, then all superblock will contain the minor number 1, even if
223 the array is later assembled as /dev/md2.
226 .BR -c ", " --config=
227 config file. Default is
228 .BR /etc/mdadm.conf .
232 scan config file for missing information
236 Assemble the array even if some superblocks appear out-of-date
240 Attempt to start the array even if fewer drives were given than are
241 needed for a full array. Normally if not all drives are found and
243 is not used, then the array will be assembled but not started.
246 an attempt will be made to start it anyway.
248 .SH General management
253 hotadd listed devices.
257 remove listed devices. The must not be active. i.e. they should
258 be failed or spare devices.
262 mark listed devices as faulty.
270 start a partially built array.
274 deactivate array, releasing all resources.
277 .BR -o ", " --readonly
278 mark array as readonly.
281 .BR -w ", " --readwrite
282 mark array as readwrite.
293 .B mdadm --assemble --scan
297 This usage assembles one or more raid arrays from pre-existing components.
298 For each array, mdadm needs to know the md device, the identity of the
299 array, and a number of sub devices. These can be found in a number of ways.
301 The md device is either given before
303 or is found from the config file. In the latter case, multiple md devices
304 can be started with a single mdadm command.
306 The identity can be given with the
310 option, can be found in in the config file, or will be taken from the
311 super block on the first subdevice listed on the command line.
313 Devices can be given on the
315 command line or from the config file. Only devices which have an md
316 superblock which contains the right identity will be considered for any device.
318 The config file is only used if explicitly named with
328 is not given, then the config file will only be used to find the
329 identity of md arrays.
331 Normally the array will be started after it is assembled. However is
333 is not given and insufficient drives were lists to start a complete
334 (non-degraded) array, then the array is not started (to guard against
335 usage errors). To insist that the array be started in this case (as
336 may work for RAID1 or RAID5), give the
353 This usage is similar to
355 The difference is that it creates a legacy array without a superblock. With
356 these arrays there is no difference between initially creating the array and
357 subsequently assembling the array, except that hopefully there is useful
358 data there in the second case.
360 The level may only be 0, raid0, or linear. All devices must be listed
361 and the array will be started once complete.
376 This usage will initialise a new md array, associate some devices with
377 it, and activate the array.
379 As devices are added, they are checked to see if they contain raid
380 superblocks or filesystems. They are also check to see if the variance in
381 device size exceeds 1%.
383 If any discrepancy is found, the array will not automatically be run, though
386 can override this caution.
390 '''option is given, it is not necessary to list any subdevices in this command.
391 '''They can be added later, before a
395 '''is given, the apparent size of the smallest drive given is used.
397 The General Management options that are valid with --create are:
400 insist of running the array even if some devices look like they might
405 start the array readonly - not supported yet.
415 This usage sill print out the details of the given array including a
416 list of component devices. To determine names for the devices,
420 for device files with the right major and minor numbers.
425 prints a single line that identifies the level, number of disks, and
426 UUID of the array. This line is suitable for inclusion in
427 .BR /etc/mdadm.conf .
437 This usage will examine some block devices to see if that have a valid
438 RAID superblock on them. The information in each valid raid
439 superblock will be printed.
443 is used, the no devices should be listed, and the complete set of
444 devices identified in the configuration file are checked.
448 but this implication can be countered by specifying
454 will output an config file entry of each distinct array that was
455 found. This entry will list the UUID, the raid level, and a list of
456 the individual devices on which a superblock for that array was found.
457 This output will by syntactically suitable for inclusion in the
458 configuration file, but should
460 be used blindly. Often the array description that you want in the
461 configuration file is much less specific than that given by
463 For example, you normally do not want to list the devices,
464 particularly if they are SCSI devices.
477 gives you informations about md devices status.
478 This file is not currently used by
483 The config file lists which devices may be scanned to see if
484 they contain MD super block, and gives identifying information
485 (e.g. UUID) about known MD arrays. See
492 Finish and document Follow mode.
495 For information on the various levels of
499 .UR http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
500 http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
503 for new releases of the RAID driver check out:
506 .UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
507 ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
512 .UR http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/
513 http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/