4 mdadm \- manage MD devices
10 .BI mdadm " [mode] <raiddevice> [options] <component-devices>"
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 only provides limited support for 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 Query, Detail, and Examine)
65 mdadm has 6 major modes of operation:
68 Assemble the parts of a previously created
69 array into an active array. Components can be explicitly given
70 or can be searched for.
72 checks that the components
73 do form a bona fide array, and can, on request, fiddle superblock
74 information so as to assemble a faulty array.
78 Build a legacy array without per-device superblocks.
82 Create a new array with per-device superblocks.
84 '''in several step create-add-add-run or it can all happen with one command.
88 This is for doing things to specific components of an array such as
89 adding new spares and removing faulty devices.
93 This mode allows operations on independent devices such as examine MD
94 superblocks, erasing old superblocks and stopping active arrays.
97 .B "Follow or Monitor"
98 Monitor one or more md devices and act on any state changes.
102 Available options are:
105 .BR -A ", " --assemble
106 Assemble an existing array.
110 Build a legacy array without superblocks.
118 Examine a device to see
119 (1) if it is an md device and (2) if it is a component of an md
121 Information about what is discovered is presented.
125 Print detail of one or more md devices.
128 .BR -E ", " --examine
129 Print content of md superblock on device(s).
132 .BR -F ", " --follow ", " --monitor
139 Display help message or, after above option, mode specific help message.
142 .BR -V ", " --version
143 Print version information for mdadm.
146 .BR -v ", " --verbose
147 Be more verbose about what is happening.
151 Be less verbose. This is used with
158 Be more forceful about certain operations. See the various modes of
159 the exact meaning of this option in different contexts.
162 .BR -c ", " --config=
163 Specify the config file. Default is
164 .BR /etc/mdadm.conf .
170 for missing information.
171 In general, this option gives
173 permission to get any missing information, like component devices,
174 array devices, array identities, and alert destination from the
176 .BR /etc/mdadm.conf .
177 One exception is MISC mode when using
183 says to get a list of array devices from
186 .SH For create or build:
190 Specify chunk size of kibibytes. The default is 64.
194 Specify rounding factor for linear array (==chunk size)
198 Set raid level. Options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid5, 4,
199 raid5, 5, multipath, mp. Obviously some of these are synonymous.
200 Only the first 4 are valid when Building.
203 .BR -p ", " --parity=
204 Set raid5 parity algorithm. Options are:
205 {left,right}-{,a}symmetric, la, ra, ls, rs. The default is left-symmetric.
212 .BR -n ", " --raid-disks=
213 number of active devices in array.
216 .BR -x ", " --spare-disks=
217 number of spare (eXtra) disks in initial array. Spares can be added
222 Amount (in Kibibytes) of space to use from each drive in RAID1/4/5.
223 This must be a multiple of the chunk size, and must leave about 128Kb
224 of space at the end of the drive for the RAID superblock.
225 If this is not specified
226 (as it normally is not) the smallest drive (or partition) sets the
227 size, though if there is a variance among the drives of greater than 1%, a warning is
234 uuid of array to assemble. Devices which don't have this uuid are
238 .BR -m ", " --super-minor=
239 Minor number of device that array was created for. Devices which
240 don't have this minor number are excluded. If you create an array as
241 /dev/md1, then all superblock will contain the minor number 1, even if
242 the array is later assembled as /dev/md2.
246 Assemble the array even if some superblocks appear out-of-date
250 Attempt to start the array even if fewer drives were given than are
251 needed for a full array. Normally if not all drives are found and
253 is not used, then the array will be assembled but not started.
256 an attempt will be made to start it anyway.
263 hotadd listed devices.
267 remove listed devices. The must not be active. i.e. they should
268 be failed or spare devices.
272 mark listed devices as faulty.
282 start a partially built array.
286 deactivate array, releasing all resources.
289 .BR -o ", " --readonly
290 mark array as readonly.
293 .BR -w ", " --readwrite
294 mark array as readwrite.
298 If the device contains a valid md superblock, the block is
299 over-written with zeros. With
301 the block where the superblock would be is over-written even if it
302 doesn't appear to be valid.
304 .SH For Monitor mode:
307 Give a mail address to send alerts to.
310 .BR -p ", " --program ", " --alert
311 Give a program to be run whenever an event is detected.
315 Give a delay in seconds.
317 polls the md arrays and then waits this many seconds before polling
318 again. The default is 60 seconds.
328 .B mdadm --assemble --scan
332 This usage assembles one or more raid arrays from pre-existing components.
333 For each array, mdadm needs to know the md device, the identity of the
334 array, and a number of component-devices. These can be found in a number of ways.
336 The md device is either given before
338 or is found from the config file. In the latter case, multiple md devices
339 can be started with a single mdadm command.
341 The identity can be given with the
345 option, can be found in in the config file, or will be taken from the
346 super block on the first component-device listed on the command line.
348 Devices can be given on the
350 command line or from the config file. Only devices which have an md
351 superblock which contains the right identity will be considered for any device.
353 The config file is only used if explicitly named with
363 is not given, then the config file will only be used to find the
364 identity of md arrays.
366 Normally the array will be started after it is assembled. However is
368 is not given and insufficient drives were lists to start a complete
369 (non-degraded) array, then the array is not started (to guard against
370 usage errors). To insist that the array be started in this case (as
371 may work for RAID1 or RAID5), give the
388 This usage is similar to
390 The difference is that it creates a legacy array without a superblock. With
391 these arrays there is no difference between initially creating the array and
392 subsequently assembling the array, except that hopefully there is useful
393 data there in the second case.
395 The level may only be 0, raid0, or linear. All devices must be listed
396 and the array will be started once complete.
411 This usage will initialise a new md array, associate some devices with
412 it, and activate the array.
414 As devices are added, they are checked to see if they contain raid
415 superblocks or filesystems. They are also check to see if the variance in
416 device size exceeds 1%.
418 If any discrepancy is found, the array will not automatically be run, though
421 can override this caution.
425 '''option is given, it is not necessary to list any component-devices in this command.
426 '''They can be added later, before a
430 '''is given, the apparent size of the smallest drive given is used.
432 The General Management options that are valid with --create are:
435 insist of running the array even if some devices look like they might
440 start the array readonly - not supported yet.
447 .I options... devices...
450 This usage will allow individual devices in an array to be failed,
451 removed or added. It is possible to perform multiple operations with
452 on command. For example:
454 mdadm /dev/md0 -f /dev/hda1 -r /dev/hda1 /a /dev/hda1
460 and will then remove it from the array and finally add it back
461 in as a spare. However only one md array can be affect by a single
472 MISC mode includes a number if distinct operations that
473 operate on distinct devices. The operations are:
476 The device is examined to see if it is
477 (1) an active md array, or
478 (2) a component of an md array.
479 The information discovered is reported.
483 The device should be an active md device. mdadm will display
484 a detailed description of the array.
486 will cause the output to be less detailed and format to be
487 suitable for inclusion in
488 .BR /etc/mdadm.conf .
492 The device should be a component of an md array. mdadm will
493 read the md superblock of the device and display the contents.
498 then multiple devices that are components of the one array
499 are grouped together and reported in a single entry suitable
501 .BR /etc/mdadm.conf .
505 without listing any devices will cause all devices listed in the
506 config file to be examined.
510 This devices should active md arrays which will be deactivated, if
511 they are not currently in use.
515 This will fully activate a partially assembled md array.
519 This will mark an active array as read-only, providing that it is
520 not currently being used.
526 array back to being read/write.
533 .I options... devices...
538 to periodically poll a number of md arrays and to report on any events
541 will never exit once it decides that there are arrays to be checked,
542 so it should normally be run in the background.
544 If any devices are listed on the command line,
546 will only monitor those devices. Otherwise all arrays listed in the
547 configuration file will be monitored. Further, if
549 is given, then any other md devices that appear in
551 will also be monitored.
553 The result of monitoring the arrays is the generation of events.
554 These events are passed to a separate program (is specified) and may
555 be mail to a given E-mail address.
560 is given, then a program or an E-mail address must be specified on the
561 command line or in the config file. If neither are available, then
563 will not monitor anything.
567 will continue monitoring along as something was found to monitor. If
568 no program or email is given, then each event is reported to
571 The different events are:
576 An md array which previously was configured appear to no longer be
581 An md array started reconstruction.
587 is 20, 40, 60, or 80, this indicates that rebuild has passed that many
588 percentage of the total.
592 An active component device of an array has been marked as faulty.
596 A spare component device which was being rebuilt to replace a faulty
601 A spare component device which was being rebuilt to replace a faulty
602 device as been successfully rebuild and has been made active.
606 A new md array has been detected in the
612 A spare drive has been moved from one array in a
614 to another to allow a failed drive to be replaced.
622 cause Email to be sent. All events cause the program to be run.
623 The program is run with two or three arguments, they being the event
624 name, the array device and possibly a second device.
626 Each event has an associated array device (e.g.
628 and possibly a second device. For
633 the second device is the relevant component device.
636 the second device is the array that the spare was moved from.
640 to move spares from one array to another, the different arrays need to
641 be labelled with the same
643 in the configuration file. The
645 name can be any string. It is only necessary that different spare
646 groups use different name.
650 detects that an array which is in a spare group has fewer active
651 devices than necessary for the complete array, and has no spare
652 devices, it will look for another array in the same spare group that
653 has a full complement of working drive and a spare. It will then
654 attempt to remove the spare from the second drive and add it to the
656 If the removal succeeds but the adding fails, then it is added back to
671 gives you informations about md devices status.
672 This file is not currently used by
677 The config file lists which devices may be scanned to see if
678 they contain MD super block, and gives identifying information
679 (e.g. UUID) about known MD arrays. See
686 Finish and document Follow mode.
689 For information on the various levels of
693 .UR http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
694 http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
697 for new releases of the RAID driver check out:
700 .UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
701 ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches
706 .UR http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/
707 http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/