1MDADM.CONF(5)                 File Formats Manual                MDADM.CONF(5)
2
3
4

NAME

6       mdadm.conf - configuration for management of Software RAID with mdadm
7

SYNOPSIS

9       /etc/mdadm.conf
10

DESCRIPTION

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 either of both  of  the
46              words containers and partitions.  The word containers will cause
47              mdadm to look for assembled CONTAINER arrays and  included  them
48              as a source for assembling further arrays.
49
50              The  word  partitions  will cause mdadm to read /proc/partitions
51              and include all devices and  partitions  found  therein.   mdadm
52              does  not use the names from /proc/partitions but only the major
53              and minor device numbers.  It scans /dev to find the  name  that
54              matches the numbers.
55
56              If  no  DEVICE line is present, then "DEVICE partitions contain‐
57              ers" is assumed.
58
59              For example:
60
61              DEVICE /dev/hda* /dev/hdc*
62              DEV    /dev/sd*
63              DEVICE /dev/disk/by-path/pci*
64              DEVICE partitions
65
66
67       ARRAY  The ARRAY lines identify actual arrays.  The second word on  the
68              line  may  be the name of the device where the array is normally
69              assembled, such as /dev/md1 or /dev/md/backup.  If the name does
70              not  start  with  a  slash  ('/'),  it  is  treated  as being in
71              /dev/md/.  Alternately the word <ignore>  (complete  with  angle
72              brackets) can be given in which case any array which matches the
73              rest of the line will never be automatically assembled.   If  no
74              device  name  is  given,  mdadm  will  use various heuristics to
75              determine an appropriate name.
76
77              Subsequent words identify the array, or identify the array as  a
78              member of a group. If multiple identities are given, then a com‐
79              ponent device must match  ALL  identities  to  be  considered  a
80              match.   Each identity word has a tag, and equals sign, and some
81              value.  The tags are:
82
83           uuid=  The value should be a 128  bit  uuid  in  hexadecimal,  with
84                  punctuation  interspersed  if  desired.  This must match the
85                  uuid stored in the superblock.
86
87           name=  The value should be a simple textual name as  was  given  to
88                  mdadm  when the array was created.  This must match the name
89                  stored in the superblock on a device for that device  to  be
90                  included  in  the array.  Not all superblock formats support
91                  names.
92
93           super-minor=
94                  The value is an integer which  indicates  the  minor  number
95                  that  was  stored  in the superblock when the array was cre‐
96                  ated. When an array is created as /dev/mdX, then  the  minor
97                  number X is stored.
98
99           devices=
100                  The  value  is  a  comma  separated  list of device names or
101                  device name patterns.  Only devices with names  which  match
102                  one  entry  in  the list will be used to assemble the array.
103                  Note that the devices listed there must also be listed on  a
104                  DEVICE line.
105
106           level= The  value  is  a  raid level.  This is not normally used to
107                  identify an array, but is supported so that the output of
108
109                  mdadm --examine --scan
110
111                  can be use directly in the configuration file.
112
113           num-devices=
114                  The value is the number of  devices  in  a  complete  active
115                  array.  As with level= this is mainly for compatibility with
116                  the output of
117
118                  mdadm --examine --scan.
119
120
121           spares=
122                  The value is a number of spare devices to expect  the  array
123                  to  have.  The sole use of this keyword and value is as fol‐
124                  lows: mdadm --monitor will report an array if it is found to
125                  have  fewer than this number of spares when --monitor starts
126                  or when --oneshot is used.
127
128
129           spare-group=
130                  The value is a textual name for  a  group  of  arrays.   All
131                  arrays  with  the same spare-group name are considered to be
132                  part of the same group.  The  significance  of  a  group  of
133                  arrays  is that mdadm will, when monitoring the arrays, move
134                  a spare drive from one array in a group to another array  in
135                  that  group if the first array had a failed or missing drive
136                  but no spare.
137
138
139           auto=  This option is rarely needed with mdadm-3.0, particularly if
140                  use  with the Linux kernel v2.6.28 or later.  It tells mdadm
141                  whether to  use  partitionable  array  or  non-partitionable
142                  arrays  and,  in  the  absence  of  udev, how many partition
143                  devices to create.  From 2.6.28 all  md  array  devices  are
144                  partitionable, hence this option is not needed.
145
146                  The  value  of  this option can be "yes" or "md" to indicate
147                  that a traditional, non-partitionable  md  array  should  be
148                  created,  or "mdp", "part" or "partition" to indicate that a
149                  partitionable md array (only  available  in  linux  2.6  and
150                  later)  should be used.  This later set can also have a num‐
151                  ber appended to  indicate  how  many  partitions  to  create
152                  device files for, e.g.  auto=mdp5.  The default is 4.
153
154
155           bitmap=
156                  The  option  specifies a file in which a write-intent bitmap
157                  should be found.  When assembling the array, mdadm will pro‐
158                  vide  this  file  to the md driver as the bitmap file.  This
159                  has  the  same  function  as  the  --bitmap-file  option  to
160                  --assemble.
161
162
163           metadata=
164                  Specify  the  metadata  format  that the array has.  This is
165                  mainly recognised for comparability with the output of mdadm
166                  -Es.
167
168
169           container=
170                  Specify that this array is a member array of some container.
171                  The value given can be either a path name in /dev, or a UUID
172                  of the container array.
173
174
175           member=
176                  Specify that this array is a member array of some container.
177                  Each type of container has  some  way  to  enumerate  member
178                  arrays,  often  a simple sequence number.  The value identi‐
179                  fies which member of a container the array is.  It will usu‐
180                  ally accompany a "container=" word.
181
182
183       MAILADDR
184              The  mailaddr line gives an E-mail address that alerts should be
185              sent to when mdadm is running in --monitor mode (and  was  given
186              the  --scan option).  There should only be one MAILADDR line and
187              it should have only one address.
188
189
190
191       MAILFROM
192              The mailfrom line (which can only be abbreviated to at  least  5
193              characters) gives an address to appear in the "From" address for
194              alert mails.  This can be useful if you want to explicitly set a
195              domain,  as  the  default from address is "root" with no domain.
196              All words on this line are catenated with  spaces  to  form  the
197              address.
198
199              Note  that  this  value cannot be set via the mdadm commandline.
200              It is only settable via the config file.
201
202
203       PROGRAM
204              The program line gives the name of a  program  to  be  run  when
205              mdadm --monitor detects potentially interesting events on any of
206              the arrays that it is monitoring.  This program  gets  run  with
207              two or three arguments, they being the Event, the md device, and
208              possibly the related component device.
209
210              There should only be one program line and it should be give only
211              one program.
212
213
214
215       CREATE The  create  line  gives default values to be used when creating
216              arrays and device entries for arrays.  These include:
217
218
219           owner=
220
221           group= These can give user/group ids or names  to  use  instead  of
222                  system defaults (root/wheel or root/disk).
223
224           mode=  An octal file mode such as 0660 can be given to override the
225                  default of 0600.
226
227           auto=  This corresponds to the --auto flag to mdadm.  Give yes, md,
228                  mdp, part — possibly followed by a number of partitions — to
229                  indicate how missing device entries should be created.
230
231
232           metadata=
233                  The name of the metadata format to use if none is explicitly
234                  given.   This  can be useful to impose a system-wide default
235                  of version-1 superblocks.
236
237
238           symlinks=no
239                  Normally when creating devices in /dev/md/ mdadm will create
240                  a  matching  symlink  from  /dev/ with a name starting md or
241                  md_.  Give symlinks=no to suppress this symlink creation.
242
243
244       HOMEHOST
245              The homehost line gives a  default  value  for  the  --homehost=
246              option  to  mdadm.  There should normally be only one other word
247              on the line.  It should either be a host name,  or  one  of  the
248              special words <system> and <ignore>.  If <system> is given, then
249              the gethostname(2) systemcall is used to get the host name.
250
251              If <ignore> is given, then a flag is set so that when arrays are
252              being  auto-assembled  the  checking of the recorded homehost is
253              disabled.  If <ignore> is given it is also possible to  give  an
254              explicit  name which will be used when creating arrays.  This is
255              the only case when there can be more that one other word on  the
256              HOMEHOST line.
257
258              When  arrays  are  created, this host name will be stored in the
259              metadata.  When arrays are assembled using auto-assembly, arrays
260              which  do not record the correct homehost name in their metadata
261              will be assembled using a  "foreign"  name.   A  "foreign"  name
262              alway ends with a digit string preceded by an underscore to dif‐
263              ferentiate it from any possible local name. e.g.  /dev/md/1_1 or
264              /dev/md/home_0.
265
266       AUTO   A  list  of names of metadata format can be given, each preceded
267              by a plus or minus sign.  Also the word homehost is  allowed  as
268              is all preceded by plus or minus sign.  all is usually last.
269
270              When mdadm is auto-assembling an array, either via --assemble or
271              --incremental and it finds metadata of a given type,  it  checks
272              that metadata type against those listed in this line.  The first
273              match wins, where all matches anything.  If  a  match  is  found
274              that  was preceded by a plus sign, the auto assembly is allowed.
275              If the match was preceded by a minus sign, the auto assembly  is
276              disallowed.  If no match is found, the auto assembly is allowed.
277
278              If  the  metadata  indicates that the array was created for this
279              host, and the word homehost appears before any other match, then
280              the array is treated as a valid candidate for auto-assembly.
281
282              This  can  be  used  to  disable all auto-assembly (so that only
283              arrays explicitly listed in mdadm.conf or on  the  command  line
284              are assembled), or to disable assembly of certain metadata types
285              which might be handled by other software.  It can also  be  used
286              to disable assembly of all foreign arrays - normally such arrays
287              are assembled but given a non-deterministic name in /dev/md/.
288
289              The known metadata types are 0.90, 1.x, ddf, imsm.
290
291

EXAMPLE

293       DEVICE /dev/sd[bcdjkl]1
294       DEVICE /dev/hda1 /dev/hdb1
295
296       # /dev/md0 is known by its UUID.
297       ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
298       # /dev/md1 contains all devices with a minor number of
299       #   1 in the superblock.
300       ARRAY /dev/md1 superminor=1
301       # /dev/md2 is made from precisely these two devices
302       ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
303
304       # /dev/md4 and /dev/md5 are a spare-group and spares
305       #  can be moved between them
306       ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
307                  spare-group=group1
308       ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
309                  spare-group=group1
310       # /dev/md/home is created if need to be a partitionable md array
311       # any spare device number is allocated.
312       ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
313                  auto=part
314
315       MAILADDR root@mydomain.tld
316       PROGRAM /usr/sbin/handle-mdadm-events
317       CREATE group=system mode=0640 auto=part-8
318       HOMEHOST <system>
319       AUTO +1.x homehost -all
320
321

SEE ALSO

323       mdadm(8), md(4).
324
325
326
327
328                                                                 MDADM.CONF(5)
Impressum