6 mdadm - manage MD devices _
\ba_
\bk_
\ba Linux Software Raid.
9 S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
10 m
\bmd
\bda
\bad
\bdm
\bm _
\b[_
\bm_
\bo_
\bd_
\be_
\b] _
\b<_
\br_
\ba_
\bi_
\bd_
\bd_
\be_
\bv_
\bi_
\bc_
\be_
\b> _
\b[_
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\bs_
\b] _
\b<_
\bs_
\bu_
\bb_
\bd_
\be_
\bv_
\bi_
\bc_
\be_
\bs_
\b>
13 D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
14 RAID devices are virtual devices created from two or more
15 real block devices. This allows multiple devices (typi-
16 cally disk drives or partitions there-of) to be combined
17 into a single device to hold (for example) a single
18 filesystem. Some RAID levels included redundancy and so
19 can survive some degree of device failure.
21 Linux Software RAID devices are implemented through the md
22 (Multiple Devices) device driver.
24 Currently, Linux supports L
\bLI
\bIN
\bNE
\bEA
\bAR
\bR md devices, R
\bRA
\bAI
\bID
\bD0
\b0 (strip-
25 ing), R
\bRA
\bAI
\bID
\bD1
\b1 (mirroring), R
\bRA
\bAI
\bID
\bD4
\b4 and R
\bRA
\bAI
\bID
\bD5
\b5.
\b.
27 Recent kernels (2002) also support a mode known as M
\bMU
\bUL
\bLT
\bTI
\bI-
\b-
28 P
\bPA
\bAT
\bTH
\bH. m
\bmd
\bda
\bad
\bdm
\bm does not support MULTIPATH as yet.
30 m
\bmd
\bda
\bad
\bdm
\bm is a program that can be used to create and manage
31 MD devices. As such it provides a similar set of func-
32 tionality to the r
\bra
\bai
\bid
\bdt
\bto
\boo
\bol
\bls
\bs packages. The key differences
33 between m
\bmd
\bda
\bad
\bdm
\bm and r
\bra
\bai
\bid
\bdt
\bto
\boo
\bol
\bls
\bs are:
35 +
\bo m
\bmd
\bda
\bad
\bdm
\bm is a single program and not a collection of pro-
38 +
\bo m
\bmd
\bda
\bad
\bdm
\bm can perform (almost) all of its functions with-
39 out having a configuration file. Also mdadm helps
40 with management of the configuration file.
42 +
\bo m
\bmd
\bda
\bad
\bdm
\bm can provide information about your arrays
43 (through Detail and Examine) that r
\bra
\bai
\bid
\bdt
\bto
\boo
\bol
\bls
\bs cannot.
45 +
\bo r
\bra
\bai
\bid
\bdt
\bto
\boo
\bol
\bls
\bs can manage MULTIPATH devices which m
\bmd
\bda
\bad
\bdm
\bm
50 mdadm has 7 major modes of operation:
52 A
\bAs
\bss
\bse
\bem
\bmb
\bbl
\ble
\be
53 Assemble the parts of a previously created array
54 into an active array. Components can be explicitly
55 given or can be searched for. m
\bmd
\bda
\bad
\bdm
\bm checks that
56 the components do form a bona fide array, and can,
57 on request, fiddle superblock information so as to
58 assemble a faulty array.
61 B
\bBu
\bui
\bil
\bld
\bd Build a legacy array without per-device
65 C
\bCr
\bre
\bea
\bat
\bte
\be Create a new array with per-device superblocks.
68 D
\bDe
\bet
\bta
\bai
\bil
\bl Display the details of a given md device. Details
69 include the RAID level, the number of devices,
70 which ones are faulty (if any), and the array UUID.
73 E
\bEx
\bxa
\bam
\bmi
\bin
\bne
\be
74 Examine a device to see if it is part of an md
75 array, and print out the details of that array.
76 This mode can also be used to examine a large num-
77 ber of devices and to print out a summary of the
78 arrays found in a format suitable for the
79 m
\bmd
\bda
\bad
\bdm
\bm.
\b.c
\bco
\bon
\bnf
\bf configuration file.
82 F
\bFo
\bol
\bll
\blo
\bow
\bw o
\bor
\br M
\bMo
\bon
\bni
\bit
\bto
\bor
\br
83 Monitor one or more md devices and act on any state
87 M
\bMa
\ban
\bna
\bag
\bge
\be This is for odd bits an pieces like hotadd,
88 hotremove, setfaulty, stop, readonly, readwrite.
91 O
\bOP
\bPT
\bTI
\bIO
\bON
\bNS
\bS
92 Available options are:
95 -
\b-A
\bA, -
\b--
\b-a
\bas
\bss
\bse
\bem
\bmb
\bbl
\ble
\be
96 Assemble an existing array.
99 -
\b-B
\bB, -
\b--
\b-b
\bbu
\bui
\bil
\bld
\bd
100 Build a legacy array without superblocks.
103 -
\b-C
\bC, -
\b--
\b-c
\bcr
\bre
\bea
\bat
\bte
\be
107 -
\b-D
\bD, -
\b--
\b-d
\bde
\bet
\bta
\bai
\bil
\bl
108 Print detail of one or more md devices.
111 -
\b-E
\bE, -
\b--
\b-e
\bex
\bxa
\bam
\bmi
\bin
\bne
\be
112 Print content of md superblock on device(s).
115 -
\b-F
\bF, -
\b--
\b-f
\bfo
\bol
\bll
\blo
\bow
\bw, -
\b--
\b-m
\bmo
\bon
\bni
\bit
\bto
\bor
\br
116 Select M
\bMo
\bon
\bni
\bit
\bto
\bor
\br mode.
119 -
\b-h
\bh, -
\b--
\b-h
\bhe
\bel
\blp
\bp
120 Display help message or, after above option, mode
121 specific help message.
124 -
\b-V
\bV, -
\b--
\b-v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn
125 Print version information for mdadm.
128 -
\b-v
\bv, -
\b--
\b-v
\bve
\ber
\brb
\bbo
\bos
\bse
\be
129 Be more verbose about what is happening.
132 -
\b-b
\bb, -
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf
133 Be less verbose. This is used with -
\b--
\b-d
\bde
\bet
\bta
\bai
\bil
\bl and
134 -
\b--
\b-e
\bex
\bxa
\bam
\bmi
\bin
\bne
\be.
137 F
\bFo
\bor
\br c
\bcr
\bre
\bea
\bat
\bte
\be o
\bor
\br b
\bbu
\bui
\bil
\bld
\bd:
\b:
138 -
\b-c
\bc, -
\b--
\b-c
\bch
\bhu
\bun
\bnk
\bk=
\b=
139 Specify chunk size of kibibytes. The default is
143 -
\b--
\b-r
\bro
\bou
\bun
\bnd
\bdi
\bin
\bng
\bg=
\b=
144 Specify rounding factor for linear array (==chunk
148 -
\b-l
\bl, -
\b--
\b-l
\ble
\bev
\bve
\bel
\bl=
\b=
149 Set raid level. Options are: linear, raid0, 0,
150 stripe, raid1, 1, mirror, raid5, 4, raid5, 5.
151 Obviously some of these are synonymous. Only the
152 first 4 are valid when Building.
155 -
\b-p
\bp, -
\b--
\b-p
\bpa
\bar
\bri
\bit
\bty
\by=
\b=
156 Set raid5 parity algorithm. Options are:
157 {left,right}-{,a}symmetric, la, ra, ls, rs. The
158 default is left-symmetric.
161 -
\b--
\b-l
\bla
\bay
\byo
\bou
\but
\bt=
\b=
165 -
\b-n
\bn, -
\b--
\b-r
\bra
\bai
\bid
\bd-
\b-d
\bdi
\bis
\bsk
\bks
\bs=
\b=
166 number of active devices in array.
169 -
\b-x
\bx, -
\b--
\b-s
\bsp
\bpa
\bar
\bre
\be-
\b-d
\bdi
\bis
\bsk
\bks
\bs=
\b=
170 number of spare (eXtra) disks in initial array.
171 Spares can be added and removed later.
174 -
\b-z
\bz, -
\b--
\b-s
\bsi
\biz
\bze
\be=
\b=
175 Amount (in Kibibytes) of space to use from each
176 drive in RAID1/4/5. This must be a multiple of the
177 chunk size, and must leave about 128Kb of space at
178 the end of the drive for the RAID superblock. If
179 this is not specified (as it normally is not) the
180 smallest drive (or partition) sets the size, though
181 if there is a variance among the drives of greater
182 than 1%, a warning is issued.
185 F
\bFo
\bor
\br a
\bas
\bss
\bse
\bem
\bmb
\bbl
\ble
\be:
\b:
186 -
\b-u
\bu, -
\b--
\b-u
\buu
\bui
\bid
\bd=
\b=
187 uuid of array to assemble. Devices which don't have
188 this uuid are excluded
191 -
\b-m
\bm, -
\b--
\b-s
\bsu
\bup
\bpe
\ber
\br-
\b-m
\bmi
\bin
\bno
\bor
\br=
\b=
192 Minor number of device that array was created for.
193 Devices which don't have this minor number are
194 excluded. If you create an array as /dev/md1, then
195 all superblock will contain the minor number 1,
196 even if the array is later assembled as /dev/md2.
199 -
\b-c
\bc, -
\b--
\b-c
\bco
\bon
\bnf
\bfi
\big
\bg=
\b=
200 config file. Default is /
\b/e
\bet
\btc
\bc/
\b/m
\bmd
\bda
\bad
\bdm
\bm.
\b.c
\bco
\bon
\bnf
\bf.
203 -
\b-s
\bs, -
\b--
\b-s
\bsc
\bca
\ban
\bn
204 scan config file for missing information
207 -
\b-f
\bf, -
\b--
\b-f
\bfo
\bor
\brc
\bce
\be
208 Assemble the array even if some superblocks appear
212 -
\b-R
\bR, -
\b--
\b-r
\bru
\bun
\bn
213 Attempt to start the array even if fewer drives
214 were given than are needed for a full array. Nor-
215 mally if not all drives are found and -
\b--
\b-s
\bsc
\bca
\ban
\bn is not
216 used, then the array will be assembled but not
217 started. With -
\b--
\b-r
\bru
\bun
\bn an attempt will be made to
221 G
\bGe
\ben
\bne
\ber
\bra
\bal
\bl m
\bma
\ban
\bna
\bag
\bge
\bem
\bme
\ben
\bnt
\bt
222 -
\b-a
\ba, -
\b--
\b-a
\bad
\bdd
\bd
223 hotadd listed devices.
226 -
\b-r
\br, -
\b--
\b-r
\bre
\bem
\bmo
\bov
\bve
\be
227 remove listed devices. The must not be active.
228 i.e. they should be failed or spare devices.
231 -
\b-f
\bf, -
\b--
\b-f
\bfa
\bai
\bil
\bl
232 mark listed devices as faulty.
235 -
\b--
\b-s
\bse
\bet
\bt-
\b-f
\bfa
\bau
\bul
\blt
\bty
\by
239 -
\b-R
\bR, -
\b--
\b-r
\bru
\bun
\bn
240 start a partially built array.
243 -
\b-S
\bS, -
\b--
\b-s
\bst
\bto
\bop
\bp
244 deactivate array, releasing all resources.
247 -
\b-o
\bo, -
\b--
\b-r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by
248 mark array as readonly.
251 -
\b-w
\bw, -
\b--
\b-r
\bre
\bea
\bad
\bdw
\bwr
\bri
\bit
\bte
\be
252 mark array as readwrite.
256 A
\bAS
\bSS
\bSE
\bEM
\bMB
\bBL
\bLY
\bY M
\bMO
\bOD
\bDE
\bE
257 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-a
\bas
\bss
\bse
\bem
\bmb
\bbl
\ble
\be _
\bd_
\be_
\bv_
\bi_
\bc_
\be _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\bs_
\b._
\b._
\b.
259 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-a
\bas
\bss
\bse
\bem
\bmb
\bbl
\ble
\be -
\b--
\b-s
\bsc
\bca
\ban
\bn _
\bo_
\bp_
\bt_
\bi_
\bo_
\bn_
\bs_
\b._
\b._
\b.
262 This usage assembles one or more raid arrays from pre-
263 existing components. For each array, mdadm needs to know
264 the md device, the identity of the array, and a number of
265 sub devices. These can be found in a number of ways.
267 The md device is either given before -
\b--
\b-s
\bsc
\bca
\ban
\bn or is found
268 from the config file. In the latter case, multiple md
269 devices can be started with a single mdadm command.
271 The identity can be given with the -
\b--
\b-u
\buu
\bui
\bid
\bd option, with the
272 -
\b--
\b-s
\bsu
\bup
\bpe
\ber
\br-
\b-m
\bmi
\bin
\bno
\bor
\br option, can be found in in the config file,
273 or will be taken from the super block on the first subde-
274 vice listed on the command line.
276 Devices can be given on the -
\b--
\b-a
\bas
\bss
\bse
\bem
\bmb
\bbl
\ble
\be command line or
277 from the config file. Only devices which have an md
278 superblock which contains the right identity will be con-
279 sidered for any device.
281 The config file is only used if explicitly named with
282 -
\b--
\b-c
\bco
\bon
\bnf
\bfi
\big
\bg or requested with -
\b--
\b-s
\bsc
\bca
\ban
\bn.
\b. In the later case,
283 /
\b/e
\bet
\btc
\bc/
\b/m
\bmd
\bda
\bad
\bdm
\bm.
\b.c
\bco
\bon
\bnf
\bf is used.
285 If -
\b--
\b-s
\bsc
\bca
\ban
\bn is not given, then the config file will only be
286 used to find the identity of md arrays.
288 Normally the array will be started after it is assembled.
289 However is -
\b--
\b-s
\bsc
\bca
\ban
\bn is not given and insufficient drives
290 were lists to start a complete (non-degraded) array, then
291 the array is not started (to guard against usage errors).
292 To insist that the array be started in this case (as may
293 work for RAID1 or RAID5), give the -
\b--
\b-r
\bru
\bun
\bn flag.
297 B
\bBU
\bUI
\bIL
\bLD
\bD M
\bMO
\bOD
\bDE
\bE
298 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-b
\bbu
\bui
\bil
\bld
\bd _
\bd_
\be_
\bv_
\bi_
\bc_
\be -
\b--
\b-c
\bch
\bhu
\bun
\bnk
\bk=
\b=_
\bX -
\b--
\b-l
\ble
\bev
\bve
\bel
\bl=
\b=_
\bY -
\b--
\b-r
\bra
\bai
\bid
\bd-
\b-
299 d
\bdi
\bis
\bsk
\bks
\bs=
\b=_
\bZ _
\bd_
\be_
\bv_
\bi_
\bc_
\be_
\bs
302 This usage is similar to -
\b--
\b-c
\bcr
\bre
\bea
\bat
\bte
\be. The difference is that
303 it creates a legacy array without a superblock. With these
304 arrays there is no difference between initially creating
305 the array and subsequently assembling the array, except
306 that hopefully there is useful data there in the second
309 The level may only be 0, raid0, or linear. All devices
310 must be listed and the array will be started once com-
314 C
\bCR
\bRE
\bEA
\bAT
\bTE
\bE M
\bMO
\bOD
\bDE
\bE
315 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-c
\bcr
\bre
\bea
\bat
\bte
\be _
\bd_
\be_
\bv_
\bi_
\bc_
\be -
\b--
\b-c
\bch
\bhu
\bun
\bnk
\bk=
\b=_
\bX -
\b--
\b-l
\ble
\bev
\bve
\bel
\bl=
\b=_
\bY
316 -
\b--
\b-r
\bra
\bai
\bid
\bd-
\b-d
\bdi
\bis
\bsk
\bks
\bs=
\b=_
\bZ _
\bd_
\be_
\bv_
\bi_
\bc_
\be_
\bs
319 This usage will initialise a new md array, associate some
320 devices with it, and activate the array.
322 As devices are added, they are checked to see if they con-
323 tain raid superblocks or filesystems. They are also check
324 to see if the variance in device size exceeds 1%.
326 If any discrepancy is found, the array will not automati-
327 cally be run, though the presence of a -
\b--
\b-r
\bru
\bun
\bn can override
331 The General Management options that are valid with --cre-
334 -
\b--
\b-r
\bru
\bun
\bn insist of running the array even if some devices
335 look like they might be in use.
338 -
\b--
\b-r
\bre
\bea
\bad
\bdo
\bon
\bnl
\bly
\by
339 start the array readonly - not supported yet.
342 D
\bDE
\bET
\bTA
\bAI
\bIL
\bL M
\bMO
\bOD
\bDE
\bE
343 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-d
\bde
\bet
\bta
\bai
\bil
\bl [-
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf] _
\bd_
\be_
\bv_
\bi_
\bc_
\be _
\b._
\b._
\b.
346 This usage sill print out the details of the given array
347 including a list of component devices. To determine names
348 for the devices, m
\bmd
\bda
\bad
\bdm
\bm searches /
\b/d
\bde
\bev
\bv for device files with
349 the right major and minor numbers.
351 With -
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf m
\bmd
\bda
\bad
\bdm
\bm prints a single line that identifies
352 the level, number of disks, and UUID of the array. This
353 line is suitable for inclusion in /
\b/e
\bet
\btc
\bc/
\b/m
\bmd
\bda
\bad
\bdm
\bm.
\b.c
\bco
\bon
\bnf
\bf.
356 E
\bEX
\bXA
\bAM
\bMI
\bIN
\bNE
\bE M
\bMO
\bOD
\bDE
\bE
357 Usage: m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-e
\bex
\bxa
\bam
\bmi
\bin
\bne
\be [-
\b--
\b-s
\bsc
\bca
\ban
\bn] [-
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf] _
\bd_
\be_
\bv_
\bi_
\bc_
\be _
\b._
\b._
\b.
359 This usage will examine some block devices to see if that
360 have a valid RAID superblock on them. The information in
361 each valid raid superblock will be printed.
363 If -
\b--
\b-s
\bsc
\bca
\ban
\bn is used, the no devices should be listed, and
364 the complete set of devices identified in the configura-
365 tion file are checked. -
\b--
\b-s
\bsc
\bca
\ban
\bn implies -
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf but this
366 implication can be countered by specifying -
\b--
\b-v
\bve
\ber
\brb
\bbo
\bos
\bse
\be.
368 With -
\b--
\b-b
\bbr
\bri
\bie
\bef
\bf m
\bmd
\bda
\bad
\bdm
\bm will output an config file entry of
369 each distinct array that was found. This entry will list
370 the UUID, the raid level, and a list of the individual
371 devices on which a superblock for that array was found.
372 This output will by syntactically suitable for inclusion
373 in the configuration file, but should N
\bNO
\bOT
\bT be used blindly.
374 Often the array description that you want in the configu-
375 ration file is much less specific than that given by m
\bmd
\bda
\bad
\bdm
\bm
376 -
\b-B
\bBs
\bs. For example, you normally do not want to list the
377 devices, particularly if they are SCSI devices.
382 /
\b/p
\bpr
\bro
\boc
\bc/
\b/m
\bmd
\bds
\bst
\bta
\bat
\bt
383 If you're using the /
\b/p
\bpr
\bro
\boc
\bc filesystem, /
\b/p
\bpr
\bro
\boc
\bc/
\b/m
\bmd
\bds
\bst
\bta
\bat
\bt gives
384 you informations about md devices status. This file is
385 not currently used by m
\bmd
\bda
\bad
\bdm
\bm.
388 /
\b/e
\bet
\btc
\bc/
\b/m
\bmd
\bda
\bad
\bdm
\bm.
\b.c
\bco
\bon
\bnf
\bf
389 The config file is line oriented with, as usual, blank
390 lines and lines beginning with a hash (or pound sign or
391 sharp or number sign, whichever you like to call it)
392 ignored. Lines that start with a blank are treated as
393 continuations of the previous line (I don't like trailing
396 Each line contains a sequence of space-separated words,
397 the first of which identified the type of line. Keywords
398 are case-insensitive, and the first work on a line can be
399 abbreviated to 3 letters.
401 There are two types of lines. ARRAY and DEVICE.
403 The DEVICE lines usually come first. All remaining words
404 on the line are treated as names of devices, possibly con-
405 taining wild cards (see _
\bg_
\bl_
\bo_
\bb(7)). These list all the
406 devices that m
\bmd
\bda
\bad
\bdm
\bm is allowed to scan when looking for
407 devices with RAID superblocks. Each line can contain mul-
408 tiple device names, and there can be multiple DEVICE
411 DEVICE /dev/hda* /dev/hdc*
413 DEVICE /dev/discs/disc*/disc
415 The ARRAY lines identify actual arrays. The second word
416 on the line should be the name of the device where the
417 array is normally assembled, such as /dev/md1. Subsequent
418 words identify the array. If multiple identities are
419 given, then the array much match ALL identities to be con-
420 sidered a match. Each identity word has a tag, and equals
421 sign, and some value. The options are:
424 u
\buu
\bui
\bid
\bd=
\b= The value should be a 128 bit uuid in hexadecimal,
425 with punctuation interspersed if desired. This
426 must match the uuid stored in the superblock.
428 s
\bsu
\bup
\bpe
\ber
\br-
\b-m
\bmi
\bin
\bno
\bor
\br=
\b=
429 The value is an integer which indicates the minor
430 number that was stored in the superblock when the
431 array was created. When an array is created as
432 /dev/mdX, then the minor number X is stored.
434 d
\bde
\bev
\bvi
\bic
\bce
\bes
\bs=
\b=
435 The value is a comma separated list of device
436 names. Precisely these devices will be used to
437 assemble the array. Note that the devices listed
438 there must also be listed on a DEVICE line.
440 l
\ble
\bev
\bve
\bel
\bl=
\b= The value is a raid level. This is normally used
441 to identify an array, but is supported so that the
442 output of m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-e
\bex
\bxa
\bam
\bmi
\bin
\bne
\be -
\b--
\b-s
\bsc
\bca
\ban
\bn can be use
443 directly in the configuration file.
445 d
\bdi
\bis
\bsk
\bks
\bs=
\b= The value is the number of disks in a complete
446 active array. As with l
\ble
\bev
\bve
\bel
\bl=
\b= this is mainly for
447 compatibility with the output of m
\bmd
\bda
\bad
\bdm
\bm -
\b--
\b-e
\bex
\bxa
\bam
\bmi
\bin
\bne
\be
448 -
\b--
\b-s
\bsc
\bca
\ban
\bn.
452 Finish and document Follow mode.
455 S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
456 For information on the various levels of RAID, check out:
459 http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
461 for new releases of the RAID driver check out:
464 ftp://ftp.kernel.org/pub/linux/kernel/peo-
465 ple/mingo/raid-patches
469 http://www.cse.unsw.edu.au/~neilb/patches/linux-
472 _
\br_
\ba_
\bi_
\bd_
\bt_
\ba_
\bb(5), _
\br_
\ba_
\bi_
\bd_
\b0_
\br_
\bu_
\bn(8), _
\br_
\ba_
\bi_
\bd_
\bs_
\bt_
\bo_
\bp(8), _
\bm_
\bk_
\br_
\ba_
\bi_
\bd(8)