MDADM.CONF(5) | File Formats Manual | MDADM.CONF(5) |
mdadm.conf - configuration for management of Software RAID with mdadm
/etc/mdadm.conf
mdadm is a tool for creating, managing, and monitoring RAID devices using the md driver in Linux.
Some common tasks, such as assembling all arrays, can be simplified by describing the devices and arrays in this configuration file.
The file should be seen as a collection of words separated by white space (space, tab, or newline). Any word that beings with a hash sign (#) starts a comment and that word together with the remainder of the line is ignored.
Spaces can be included in a word using quotation characters. Either single quotes (') or double quotes (") may be used. All the characters from one quotation character to next identical character are protected and will not be used to separate words to start new quoted strings. To include a single quote it must be between double quotes. To include a double quote it must be between single quotes.
Any line that starts with white space (space or tab) is treated as though it were a continuation of the previous line.
Empty lines are ignored, but otherwise each (non continuation) line must start with a keyword as listed below. The keywords are case insensitive and can be abbreviated to 3 characters.
The keywords are:
The device line may contain a number of different devices (separated by spaces) and each device name can contain wild cards as defined by glob(7).
Also, there may be several device lines present in the file.
Alternatively, a device line can contain either or both of the words containers and partitions. The word containers will cause mdadm to look for assembled CONTAINER arrays and included them as a source for assembling further arrays.
The word partitions will cause mdadm to read /proc/partitions and include all devices and partitions found therein. mdadm does not use the names from /proc/partitions but only the major and minor device numbers. It scans /dev to find the name that matches the numbers.
If no DEVICE line is present in any config file, then "DEVICE partitions containers" is assumed.
For example:
Subsequent words identify the array, or identify the array as a member of a group. If multiple identities are given, then a component device must match ALL identities to be considered a match. Each identity word has a tag, and equals sign, and some value. The tags are:
mdadm --examine --scan
can be use directly in the configuration file.
mdadm --examine --scan.
The value of this option can be "yes" or "md" to indicate that a traditional, non-partitionable md array should be created, or "mdp", "part" or "partition" to indicate that a partitionable md array (only available in linux 2.6 and later) should be used. This later set can also have a number appended to indicate how many partitions to create device files for, e.g. auto=mdp5. The default is 4.
Note that this value cannot be set via the mdadm commandline. It is only settable via the config file. There should only be one MAILADDR line and it should have only one address. Any subsequent addresses are silently ignored.
There should only be one program line and it should be given only one program. Any subsequent programs are silently ignored.
There should only be one create line. Any subsequent lines will override the previous settings.
Keywords used in the CREATE line and supported values are:
If <ignore> is given, then a flag is set so that when arrays are being auto-assembled the checking of the recorded homehost is disabled. If <ignore> is given it is also possible to give an explicit name which will be used when creating arrays. This is the only case when there can be more that one other word on the HOMEHOST line. If there are other words, or other HOMEHOST lines, they are silently ignored.
If <none> is given, then the default of using gethostname(2) is over-ridden and no homehost name is assumed.
When arrays are created, this host name will be stored in the metadata. When arrays are assembled using auto-assembly, arrays which do not record the correct homehost name in their metadata will be assembled using a "foreign" name. A "foreign" name alway ends with a digit string preceded by an underscore to differentiate it from any possible local name. e.g. /dev/md/1_1 or /dev/md/home_0.
There should only be one homecluster line. Any subsequent lines will be silently ignored.
When mdadm is auto-assembling an array, either via --assemble or --incremental and it finds metadata of a given type, it checks that metadata type against those listed in this line. The first match wins, where all matches anything. If a match is found that was preceded by a plus sign, the auto assembly is allowed. If the match was preceded by a minus sign, the auto assembly is disallowed. If no match is found, the auto assembly is allowed.
If the metadata indicates that the array was created for this host, and the word homehost appears before any other match, then the array is treated as a valid candidate for auto-assembly.
This can be used to disable all auto-assembly (so that only arrays explicitly listed in mdadm.conf or on the command line are assembled), or to disable assembly of certain metadata types which might be handled by other software. It can also be used to disable assembly of all foreign arrays - normally such arrays are assembled but given a non-deterministic name in /dev/md/.
The known metadata types are 0.90, 1.x, ddf, imsm.
AUTO should be given at most once. Subsequent lines are silently ignored. Thus a later config file in a config directory will not overwrite the setting in an earlier config file.
To update hot plug configuration it is necessary to execute mdadm --udev-rules command after changing the config file
Keywords used in the POLICY line and supported values are:
The action item determines the automatic behavior allowed for devices matching the path and type in the same line. If a device matches several lines with different actions then the most permissive will apply. The ordering of policy lines is irrelevant to the end result.
A PART-POLICY line should set type=disk and identify the path to one or more disk devices. Each partition on these disks will be treated according to the action= setting from this line. If a domain is set in the line, then the domain associated with each patition will be based on the domain, but with "-partN" appended, when N is the partition number for the partition that was found.
If multiple MINITORDELAY lines are provided, only first non-zero value is considered.
The default config file location, used when mdadm is running without --config option.
The default directory with config files. Used when mdadm is running without --config option, after successful reading of the /etc/mdadm.conf default config file. Files in that directory are read in lexical order.
Alternative config file that is read, when mdadm is running without --config option and the /etc/mdadm.conf default config file was not opened successfully.
The alternative directory with config files. Used when mdadm is runninng without --config option, after reading the /etc/mdadm/mdadm.conf alternative config file whether it was successful or not. Files in that directory are read in lexical order.
DEVICE /dev/sd[bcdjkl]1
DEVICE /dev/hda1 /dev/hdb1
# /dev/md0 is known by its UUID.
ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
# /dev/md1 contains all devices with a minor number of
# 1 in the superblock.
ARRAY /dev/md1 superminor=1
# /dev/md2 is made from precisely these two devices
ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
# /dev/md4 and /dev/md5 are a spare-group and spares
# can be moved between them
ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
spare-group=group1
ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
spare-group=group1
# /dev/md/home is created if need to be a partitionable md array
# any spare device number is allocated.
ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
auto=part
POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*
action=spare
POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*
action=include
# One domain comprising of devices attached to specified paths is defined.
# Bare device matching first path will be made an imsm spare on hot plug.
# If more than one array is created on devices belonging to domain1 and
# one of them becomes degraded, then any imsm spare matching any path for
# given domain name can be migrated.
MAILADDR root@mydomain.tld
PROGRAM /usr/sbin/handle-mdadm-events
CREATE group=system mode=0640 auto=part-8
HOMEHOST <system>
AUTO +1.x homehost -all
SYSFS name=/dev/md/raid5 group_thread_cnt=4 sync_speed_max=1000000
SYSFS uuid=bead5eb6:31c17a27:da120ba2:7dfda40d group_thread_cnt=4
sync_speed_max=1000000
MONITORDELAY 60
mdadm(8), md(4).