1MDADM.CONF(5) File Formats Manual MDADM.CONF(5)
2
3
4
6 mdadm.conf - configuration for management of Software Raid with mdadm
7
9 /etc/mdadm.conf
10
12 mdadm is a tool for creating, managing, and monitoring RAID devices
13 using the md driver in Linux.
14
15 Some common tasks, such as assembling all arrays, can be simplified by
16 describing the devices and arrays in this configuration file.
17
18
19 SYNTAX
20 The file should be seen as a collection of words separated by white
21 space (space, tab, or newline). Any word that beings with a hash sign
22 (#) starts a comment and that word together with the remainder of the
23 line is ignored.
24
25 Any line that starts with white space (space or tab) is treated as
26 though it were a continuation of the previous line.
27
28 Empty lines are ignored, but otherwise each (non continuation) line
29 must start with a keyword as listed below. The keywords are case
30 insensitive and can be abbreviated to 3 characters.
31
32 The keywords are:
33
34 DEVICE A device line lists the devices (whole devices or partitions)
35 that might contain a component of an MD array. When looking for
36 the components of an array, mdadm will scan these devices (or
37 any devices listed on the command line).
38
39 The device line may contain a number of different devices (sepa‐
40 rated by spaces) and each device name can contain wild cards as
41 defined by glob(7).
42
43 Also, there may be several device lines present in the file.
44
45 Alternatively, a device line can contain the word partitions.
46 This will cause mdadm to read /proc/partitions and include all
47 devices and partitions found therein. mdadm does not use the
48 names from /proc/partitions but only the major and minor device
49 numbers. It scans /dev to find the name that matches the num‐
50 bers.
51
52 If no DEVICE line is present, then "DEVICE partitions" is
53 assumed.
54
55 For example:
56
57 DEVICE /dev/hda* /dev/hdc*
58 DEV /dev/sd*
59 DEVICE /dev/discs/disc*/disc
60 DEVICE partitions
61
62
63 ARRAY The ARRAY lines identify actual arrays. The second word on the
64 line should be the name of the device where the array is nor‐
65 mally assembled, such as /dev/md1. Subsequent words identify
66 the array, or identify the array as a member of a group. If mul‐
67 tiple identities are given, then a component device must match
68 ALL identities to be considered a match. Each identity word has
69 a tag, and equals sign, and some value. The tags are:
70
71
72 uuid= The value should be a 128 bit uuid in hexadecimal, with
73 punctuation interspersed if desired. This must match the
74 uuid stored in the superblock.
75
76 name= The value should be a simple textual name as was given to
77 mdadm when the array was created. This must match the name
78 stored in the superblock on a device for that device to be
79 included in the array. Not all superblock formats support
80 names.
81
82 super-minor=
83 The value is an integer which indicates the minor number
84 that was stored in the superblock when the array was cre‐
85 ated. When an array is created as /dev/mdX, then the minor
86 number X is stored.
87
88 devices=
89 The value is a comma separated list of device names or
90 device name patterns. Only devices with names which match
91 one entry in the list will be used to assemble the array.
92 Note that the devices listed there must also be listed on a
93 DEVICE line.
94
95 level= The value is a raid level. This is not normally used to
96 identify an array, but is supported so that the output of
97
98 mdadm --examine --scan
99
100 can be use directly in the configuration file.
101
102 num-devices=
103 The value is the number of devices in a complete active
104 array. As with level= this is mainly for compatibility with
105 the output of
106
107 mdadm --examine --scan.
108
109
110 spares=
111 The value is a number of spare devices to expect the array
112 to have. mdadm --monitor will report an array if it is
113 found to have fewer than this number of spares when --moni‐
114 tor starts or when --oneshot is used.
115
116
117 spare-group=
118 The value is a textual name for a group of arrays. All
119 arrays with the same spare-group name are considered to be
120 part of the same group. The significance of a group of
121 arrays is that mdadm will, when monitoring the arrays, move
122 a spare drive from one array in a group to another array in
123 that group if the first array had a failed or missing drive
124 but no spare.
125
126
127 auto= This option declares to mdadm that it should try to create
128 the device file of the array if it doesn't already exist, or
129 exists but with the wrong device number.
130
131 The value of this option can be "yes" or "md" to indicate
132 that a traditional, non-partitionable md array should be
133 created, or "mdp", "part" or "partition" to indicate that a
134 partitionable md array (only available in linux 2.6 and
135 later) should be used. This later set can also have a num‐
136 ber appended to indicate how many partitions to create
137 device files for, e.g. auto=mdp5. The default is 4.
138
139
140 bitmap=
141 The option specifies a file in which a write-intent bitmap
142 should be found. When assembling the array, mdadm will pro‐
143 vide this file to the md driver as the bitmap file. This
144 has the same function as the --bitmap-file option to
145 --assemble.
146
147
148 metadata=
149 Specify the metadata format that the array has. This is
150 mainly recognised for comparability with the output of mdadm
151 -Es.
152
153
154
155 MAILADDR
156 The mailaddr line gives an E-mail address that alerts should be
157 sent to when is running in --monitor mode (and was given the
158 --scan option). There should only be one MAILADDR line and it
159 should have only one address.
160
161
162
163 MAILFROM
164 The mailfrom line (which can only be abbreviate at leat 5 char‐
165 acters) gives an address to appear in the "From" address for
166 alert mails. This can be useful if you want to explicitly set a
167 domain, as the default from address is "root" with no domain.
168 All words on this line are catenated with spaces to form the
169 address.
170
171 Note that this value cannot be set via the mdadm commandline.
172 It is only settable via the config file.
173
174
175 PROGRAM
176 The program line gives the name of a program to be run when
177 mdadm --monitor detects potentially interesting events on any of
178 the arrays that it is monitoring. This program gets run with
179 two or three arguments, they being the Event, the md device, and
180 possibly the related component device.
181
182 There should only be one program line and it should be give only
183 one program.
184
185
186
187 CREATE The create line gives default values to be used when creating
188 arrays and device entries for arrays. These include:
189
190
191 owner=
192
193 group= These can give user/group ids or names to use instead of
194 system defaults (root/wheel or root/disk).
195
196 mode= An octal file mode such as 0660 can be given to override the
197 default of 0600.
198
199 auto= This corresponds to the --auto flag to mdadm. Give yes, md,
200 mdp, part — possibly followed by a number of partitions — to
201 indicate how missing device entries should be created.
202
203
204 metadata=
205 The name of the metadata format to use if none is explicitly
206 given. This can be useful to impose a system-wide default
207 of version-1 superblocks.
208
209
210 symlinks=no
211 Normally when creating devices in /dev/md/ mdadm will create
212 a matching symlink from /dev/ with a name starting md or
213 md_. Give symlinks=no to suppress this symlink creation.
214
215
216
218 DEVICE /dev/sd[bcdjkl]1
219 DEVICE /dev/hda1 /dev/hdb1
220
221 # /dev/md0 is known by it's UID.
222 ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
223 # /dev/md1 contains all devices with a minor number of
224 # 1 in the superblock.
225 ARRAY /dev/md1 superminor=1
226 # /dev/md2 is made from precisey these two devices
227 ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
228
229 # /dev/md4 and /dev/md5 are a spare-group and spares
230 # can be moved between them
231 ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
232 spare-group=group1
233 ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
234 spare-group=group1
235 # /dev/md/home is created if need to be a partitionable md array
236 # any spare device number is allocated.
237 ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
238 auto=part
239
240 MAILADDR root@mydomain.tld
241 PROGRAM /usr/sbin/handle-mdadm-events
242 CREATE group=system mode=0640 auto=part-8
243 HOMEHOST <system>
244
245
247 mdadm(8), md(4).
248
249
250
251
252 MDADM.CONF(5)