1 .\" Copyright Neil Brown and others.
2 .\" This program is free software; you can redistribute it and/or modify
3 .\" it under the terms of the GNU General Public License as published by
4 .\" the Free Software Foundation; either version 2 of the License, or
5 .\" (at your option) any later version.
6 .\" See file COPYING in distribution for details.
9 mdadm.conf \- configuration for management of Software RAID with mdadm
15 is a tool for creating, managing, and monitoring RAID devices using the
19 Some common tasks, such as assembling all arrays, can be simplified
20 by describing the devices and arrays in this configuration file.
23 The file should be seen as a collection of words separated by white
24 space (space, tab, or newline).
25 Any word that beings with a hash sign (#) starts a comment and that
26 word together with the remainder of the line is ignored.
28 Spaces can be included in a word using quotation characters. Either
31 or double quotes (\fB"\fP)
32 may be used. All the characters from one quotation character to
33 next identical character are protected and will not be used to
34 separate words to start new quoted strings. To include a single quote
35 it must be between double quotes. To include a double quote it must
36 be between single quotes.
38 Any line that starts with white space (space or tab) is treated as
39 though it were a continuation of the previous line.
41 Empty lines are ignored, but otherwise each (non continuation) line
42 must start with a keyword as listed below. The keywords are case
43 insensitive and can be abbreviated to 3 characters.
50 line lists the devices (whole devices or partitions) that might contain
51 a component of an MD array. When looking for the components of an
54 will scan these devices (or any devices listed on the command line).
58 line may contain a number of different devices (separated by spaces)
59 and each device name can contain wild cards as defined by
62 Also, there may be several device lines present in the file.
66 line can contain either or both of the words
74 to look for assembled CONTAINER arrays and included them as a source
75 for assembling further arrays.
83 and include all devices and partitions found therein.
85 does not use the names from
87 but only the major and minor device numbers. It scans
89 to find the name that matches the numbers.
91 If no DEVICE line is present in any config file,
92 then "DEVICE partitions containers" is assumed.
96 DEVICE /dev/hda* /dev/hdc*
100 DEVICE /dev/disk/by-path/pci*
106 The ARRAY lines identify actual arrays. The second word on the line
107 may be the name of the device where the array is normally
112 If the name does not start with a slash
114 it is treated as being in
118 (complete with angle brackets) can be given in which case any array
119 which matches the rest of the line will never be automatically assembled.
120 If no device name is given,
122 will use various heuristics to determine an appropriate name.
124 Subsequent words identify the array, or identify the array as a member
125 of a group. If multiple identities are given,
126 then a component device must match ALL identities to be considered a
127 match. Each identity word has a tag, and equals sign, and some value.
132 The value should be a 128 bit uuid in hexadecimal, with punctuation
133 interspersed if desired. This must match the uuid stored in the
137 The value should be a simple textual name as was given to
139 when the array was created. This must match the name stored in the
140 superblock on a device for that device to be included in the array.
141 Not all superblock formats support names.
144 The value is an integer which indicates the minor number that was
145 stored in the superblock when the array was created. When an array is
146 created as /dev/mdX, then the minor number X is stored.
149 The value is a comma separated list of device names or device name
151 Only devices with names which match one entry in the list will be used
152 to assemble the array. Note that the devices
153 listed there must also be listed on a DEVICE line.
156 The value is a RAID level. This is not normally used to
157 identify an array, but is supported so that the output of
159 .B "mdadm \-\-examine \-\-scan"
161 can be use directly in the configuration file.
164 The value is the number of devices in a complete active array. As with
166 this is mainly for compatibility with the output of
168 .BR "mdadm \-\-examine \-\-scan" .
172 The value is a number of spare devices to expect the array to have.
173 The sole use of this keyword and value is as follows:
175 will report an array if it is found to have fewer than this number of
184 The value is a textual name for a group of arrays. All arrays with
187 name are considered to be part of the same group. The significance of
188 a group of arrays is that
190 will, when monitoring the arrays, move a spare drive from one array in
191 a group to another array in that group if the first array had a failed
192 or missing drive but no spare.
196 This option is rarely needed with mdadm-3.0, particularly if use with
197 the Linux kernel v2.6.28 or later.
200 whether to use partitionable array or non-partitionable arrays and,
203 how many partition devices to create. From 2.6.28 all md array
204 devices are partitionable, hence this option is not needed.
206 The value of this option can be "yes" or "md" to indicate that a
207 traditional, non-partitionable md array should be created, or "mdp",
208 "part" or "partition" to indicate that a partitionable md array (only
209 available in linux 2.6 and later) should be used. This later set can
210 also have a number appended to indicate how many partitions to create
211 device files for, e.g.
217 The option specifies a file in which a write-intent bitmap should be
218 found. When assembling the array,
220 will provide this file to the
222 driver as the bitmap file. This has the same function as the
229 Specify the metadata format that the array has. This is mainly
230 recognised for comparability with the output of
235 Specify that this array is a member array of some container. The
236 value given can be either a path name in /dev, or a UUID of the
241 Specify that this array is a member array of some container. Each
242 type of container has some way to enumerate member arrays, often a
243 simple sequence number. The value identifies which member of a
244 container the array is. It will usually accompany a "container=" word.
251 line gives an E-mail address that alerts should be
256 mode (and was given the
258 option). There should only be one
260 line and it should have only one address. Any subsequent addresses
261 are silently ignored.
267 line (which can only be abbreviated to at least 5 characters) gives an
268 address to appear in the "From" address for alert mails. This can be
269 useful if you want to explicitly set a domain, as the default from
270 address is "root" with no domain. All words on this line are
271 catenated with spaces to form the address.
273 Note that this value cannot be set via the
275 commandline. It is only settable via the config file.
276 There should only be one
278 line and it should have only one address. Any subsequent addresses
279 are silently ignored.
285 line gives the name of a program to be run when
286 .B "mdadm \-\-monitor"
287 detects potentially interesting events on any of the arrays that it
288 is monitoring. This program gets run with two or three arguments, they
289 being the Event, the md device, and possibly the related component
292 There should only be one
294 line and it should be given only one program. Any subsequent programs
295 are silently ignored.
302 line gives default values to be used when creating arrays, new members
303 of arrays, and device entries for arrays.
305 There should only be one
307 line. Any subsequent lines will override the previous settings.
311 line and supported values are:
318 These can give user/group ids or names to use instead of system
319 defaults (root/wheel or root/disk).
322 An octal file mode such as 0660 can be given to override the default
326 This corresponds to the
333 \(em possibly followed by a number of partitions \(em to indicate how
334 missing device entries should be created.
338 The name of the metadata format to use if none is explicitly given.
339 This can be useful to impose a system-wide default of version-1 superblocks.
343 Since Linux 2.6.29 it has been possible to create
345 devices with a name like
347 rather than just a number, like
350 will use the numeric alternative by default as other tools that interact
351 with md arrays may expect only numbers.
358 will use a name when appropriate.
361 is given, then non-numeric
363 device names will not be used even if the default changes in a future
371 will reserve space for a bad block list (bbl) on all devices
372 included in or added to any array that supports them. Setting
374 will prevent this, so newly added devices will not have a bad
382 line gives a default value for the
384 option to mdadm. There should normally be only one other word on the line.
385 It should either be a host name, or one of the special words
393 .BR gethostname ( 2 )
394 systemcall is used to get the host name. This is the default.
398 is given, then a flag is set so that when arrays are being
399 auto-assembled the checking of the recorded
404 is given it is also possible to give an explicit name which will be
405 used when creating arrays. This is the only case when there can be
406 more that one other word on the
408 line. If there are other words, or other
410 lines, they are silently ignored.
414 is given, then the default of using
415 .BR gethostname ( 2 )
416 is over-ridden and no homehost name is assumed.
418 When arrays are created, this host name will be stored in the
419 metadata. When arrays are assembled using auto-assembly, arrays which
420 do not record the correct homehost name in their metadata will be
421 assembled using a "foreign" name. A "foreign" name alway ends with a
422 digit string preceded by an underscore to differentiate it
423 from any possible local name. e.g.
432 line gives a default value for the
434 option to mdadm. It specifies the cluster name for the md device.
435 The md device can be assembled only on the cluster which matches
436 the name specified. If
438 is not provided, mdadm tries to detect the cluster name automatically.
440 There should only be one
442 line. Any subsequent lines will be silently ignored.
446 A list of names of metadata format can be given, each preceded by a
447 plus or minus sign. Also the word
451 preceded by plus or minus sign.
457 is auto-assembling an array, either via
461 and it finds metadata of a given type, it checks that metadata type
462 against those listed in this line. The first match wins, where
465 If a match is found that was preceded by a plus sign, the auto
466 assembly is allowed. If the match was preceded by a minus sign, the
467 auto assembly is disallowed. If no match is found, the auto assembly
470 If the metadata indicates that the array was created for
474 appears before any other match, then the array is treated as a valid
475 candidate for auto-assembly.
477 This can be used to disable all auto-assembly (so that only arrays
478 explicitly listed in mdadm.conf or on the command line are assembled),
479 or to disable assembly of certain metadata types which might be
480 handled by other software. It can also be used to disable assembly of
481 all foreign arrays - normally such arrays are assembled but given a
482 non-deterministic name in
485 The known metadata types are
492 should be given at most once. Subsequent lines are silently ignored.
493 Thus a later config file in a config directory will not overwrite
494 the setting in an earlier config file.
498 This is used to specify what automatic behavior is allowed on devices
499 newly appearing in the system and provides a way of marking spares that can
500 be moved to other arrays as well as the migration domains.
502 can be defined through
504 line by specifying a domain name for a number of paths from
505 .BR /dev/disk/by-path/ .
506 A device may belong to several domains. The domain of an array is a union
507 of domains of all devices in that array. A spare can be automatically
508 moved from one array to another if the set of the destination array's
512 of the new disk or if both arrays have the same
515 To update hot plug configuration it is necessary to execute
516 .B mdadm \-\-udev\-rules
517 command after changing the config file
521 line and supported values are:
532 file glob matching anything from
542 include, re-add, spare, spare-same-slot, or force-spare
545 yes, no, or homehost.
550 item determines the automatic behavior allowed for devices matching the
554 in the same line. If a device matches several lines with different
556 then the most permissive will apply. The ordering of policy lines
557 is irrelevant to the end result.
560 allows adding a disk to an array if metadata on that disk matches that array
563 will include the device in the array if it appears to be a current member
564 or a member that was recently removed and the array has a
565 write-intent-bitmap to allow the
570 as above and additionally: if the device is bare it can
571 become a spare if there is any array that it is a candidate for based
572 on domains and metadata.
575 as above and additionally if given slot was used by an array that went
576 degraded recently and the device plugged in has no metadata then it will
577 be automatically added to that array (or it's container)
580 as above and the disk will become a spare in remaining cases
587 and accepts the same keyword assignments. It allows a consistent set
588 of policies to applied to each of the partitions of a device.
594 and identify the path to one or more disk devices. Each partition on
595 these disks will be treated according to the
597 setting from this line. If a
599 is set in the line, then the domain associated with each patition will
600 be based on the domain, but with
602 appended, when N is the partition number for the partition that was
609 line lists custom values of MD device's sysfs attributes which will be
610 stored in sysfs after the array is assembled. Multiple lines are allowed and each
611 line has to contain the uuid or the name of the device to which it relates.
612 Lines are applied in reverse order.
616 hexadecimal identifier of MD device. This has to match the uuid stored in the
620 name of the MD device as was given to
622 when the array was created. It will be ignored if
631 line gives a delay in seconds
633 shall wait before pooling md arrays
640 command line argument takes precedence over the config file.
644 lines are provided, only first non-zero value is considered.
650 The default config file location, used when
652 is running without --config option.
656 The default directory with config files. Used when
658 is running without --config option, after successful reading of the
660 default config file. Files in that directory
661 are read in lexical order.
666 Alternative config file that is read, when
668 is running without --config option and the
670 default config file was not opened successfully.
674 The alternative directory with config files. Used when
676 is runninng without --config option, after reading the
678 alternative config file whether it was successful or not. Files in
679 that directory are read in lexical order.
682 DEVICE /dev/sd[bcdjkl]1
684 DEVICE /dev/hda1 /dev/hdb1
686 # /dev/md0 is known by its UUID.
688 ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
690 # /dev/md1 contains all devices with a minor number of
692 # 1 in the superblock.
694 ARRAY /dev/md1 superminor=1
696 # /dev/md2 is made from precisely these two devices
698 ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
700 # /dev/md4 and /dev/md5 are a spare-group and spares
702 # can be moved between them
704 ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
708 ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
712 # /dev/md/home is created if need to be a partitionable md array
714 # any spare device number is allocated.
716 ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
720 # The name of this array contains a space.
722 ARRAY /dev/md9 name='Data Storage'
724 POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*
728 POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*
732 # One domain comprising of devices attached to specified paths is defined.
734 # Bare device matching first path will be made an imsm spare on hot plug.
736 # If more than one array is created on devices belonging to domain1 and
738 # one of them becomes degraded, then any imsm spare matching any path for
740 # given domain name can be migrated.
742 MAILADDR root@mydomain.tld
744 PROGRAM /usr/sbin/handle\-mdadm\-events
746 CREATE group=system mode=0640 auto=part\-8
750 AUTO +1.x homehost \-all
752 SYSFS name=/dev/md/raid5 group_thread_cnt=4 sync_speed_max=1000000
754 SYSFS uuid=bead5eb6:31c17a27:da120ba2:7dfda40d group_thread_cnt=4
755 sync_speed_max=1000000