]>
Commit | Line | Data |
---|---|---|
11a3e71d NB |
1 | mdadm(8) mdadm(8) |
2 | ||
3 | ||
4 | ||
5 | N\bNA\bAM\bME\bE | |
6 | mdadm - manage MD devices _\ba_\bk_\ba Linux Software Raid. | |
7 | ||
8 | ||
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> | |
11 | ||
12 | ||
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. | |
20 | ||
21 | Linux Software RAID devices are implemented through the md | |
22 | (Multiple Devices) device driver. | |
23 | ||
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. | |
26 | ||
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. | |
29 | ||
30 | m\bmd\bda\bad\bdm\bm is a program that can be used to create, manage, and | |
31 | monitor MD devices. As such it provides a similar set of | |
32 | functionality to the r\bra\bai\bid\bdt\bto\boo\bol\bls\bs packages. The key differ- | |
33 | ences between m\bmd\bda\bad\bdm\bm and r\bra\bai\bid\bdt\bto\boo\bol\bls\bs are: | |
34 | ||
35 | +\bo m\bmd\bda\bad\bdm\bm is a single program and not a collection of pro- | |
36 | grams. | |
37 | ||
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. | |
41 | ||
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. | |
44 | ||
45 | +\bo r\bra\bai\bid\bdt\bto\boo\bol\bls\bs can manage MULTIPATH devices which m\bmd\bda\bad\bdm\bm | |
46 | cannot yet manage. | |
47 | ||
48 | ||
49 | M\bMO\bOD\bDE\bES\bS | |
50 | mdadm has 7 major modes of operation: | |
51 | ||
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. | |
59 | ||
60 | ||
61 | B\bBu\bui\bil\bld\bd Build a legacy array without per-device | |
62 | superblocks. | |
63 | ||
64 | ||
65 | C\bCr\bre\bea\bat\bte\be Create a new array with per-device superblocks. | |
66 | ||
67 | ||
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. | |
71 | ||
72 | ||
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. | |
80 | ||
81 | ||
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 | |
84 | changes. | |
85 | ||
86 | ||
87 | M\bMa\ban\bna\bag\bge\be This is for odd bits an pieces like hotadd, | |
88 | hotremove, setfaulty, stop, readonly, readwrite. | |
89 | ||
90 | ||
91 | O\bOP\bPT\bTI\bIO\bON\bNS\bS | |
92 | Available options are: | |
93 | ||
94 | ||
95 | -\b-A\bA, -\b--\b-a\bas\bss\bse\bem\bmb\bbl\ble\be | |
96 | Assemble an existing array. | |
97 | ||
98 | ||
99 | -\b-B\bB, -\b--\b-b\bbu\bui\bil\bld\bd | |
100 | Build a legacy array without superblocks. | |
101 | ||
102 | ||
103 | -\b-C\bC, -\b--\b-c\bcr\bre\bea\bat\bte\be | |
104 | Create a new array. | |
105 | ||
106 | ||
107 | -\b-D\bD, -\b--\b-d\bde\bet\bta\bai\bil\bl | |
108 | Print detail of one or more md devices. | |
109 | ||
110 | ||
111 | -\b-E\bE, -\b--\b-e\bex\bxa\bam\bmi\bin\bne\be | |
112 | Print content of md superblock on device(s). | |
113 | ||
114 | ||
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. | |
117 | ||
118 | ||
119 | -\b-h\bh, -\b--\b-h\bhe\bel\blp\bp | |
120 | Display help message or, after above option, mode | |
121 | specific help message. | |
122 | ||
123 | ||
124 | -\b-V\bV, -\b--\b-v\bve\ber\brs\bsi\bio\bon\bn | |
125 | Print version information for mdadm. | |
126 | ||
127 | ||
128 | -\b-v\bv, -\b--\b-v\bve\ber\brb\bbo\bos\bse\be | |
129 | Be more verbose about what is happening. | |
130 | ||
131 | ||
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. | |
135 | ||
136 | ||
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 | |
140 | 64. | |
141 | ||
142 | ||
143 | -\b--\b-r\bro\bou\bun\bnd\bdi\bin\bng\bg=\b= | |
144 | Specify rounding factor for linear array (==chunk | |
145 | size) | |
146 | ||
147 | ||
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. | |
153 | ||
154 | ||
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. | |
159 | ||
160 | ||
161 | -\b--\b-l\bla\bay\byo\bou\but\bt=\b= | |
162 | same as --parity | |
163 | ||
164 | ||
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. | |
167 | ||
168 | ||
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. | |
172 | ||
173 | ||
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. | |
183 | ||
184 | ||
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 | |
189 | ||
190 | ||
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. | |
197 | ||
198 | ||
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. | |
201 | ||
202 | ||
203 | -\b-s\bs, -\b--\b-s\bsc\bca\ban\bn | |
204 | scan config file for missing information | |
205 | ||
206 | ||
207 | -\b-f\bf, -\b--\b-f\bfo\bor\brc\bce\be | |
208 | Assemble the array even if some superblocks appear | |
209 | out-of-date | |
210 | ||
211 | ||
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 | |
218 | start it anyway. | |
219 | ||
220 | ||
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. | |
224 | ||
225 | ||
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. | |
229 | ||
230 | ||
231 | -\b-f\bf, -\b--\b-f\bfa\bai\bil\bl | |
232 | mark listed devices as faulty. | |
233 | ||
234 | ||
235 | -\b--\b-s\bse\bet\bt-\b-f\bfa\bau\bul\blt\bty\by | |
236 | same as --fail. | |
237 | ||
238 | ||
239 | -\b-R\bR, -\b--\b-r\bru\bun\bn | |
240 | start a partially built array. | |
241 | ||
242 | ||
243 | -\b-S\bS, -\b--\b-s\bst\bto\bop\bp | |
244 | deactivate array, releasing all resources. | |
245 | ||
246 | ||
247 | -\b-o\bo, -\b--\b-r\bre\bea\bad\bdo\bon\bnl\bly\by | |
248 | mark array as readonly. | |
249 | ||
250 | ||
251 | -\b-w\bw, -\b--\b-r\bre\bea\bad\bdw\bwr\bri\bit\bte\be | |
252 | mark array as readwrite. | |
253 | ||
254 | ||
255 | ||
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. | |
258 | ||
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. | |
260 | ||
261 | ||
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. | |
266 | ||
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. | |
270 | ||
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. | |
275 | ||
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. | |
280 | ||
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. | |
284 | ||
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. | |
287 | ||
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. | |
294 | ||
295 | ||
296 | ||
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 | |
300 | ||
301 | ||
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 | |
307 | case. | |
308 | ||
309 | The level may only be 0, raid0, or linear. All devices | |
310 | must be listed and the array will be started once com- | |
311 | plete. | |
312 | ||
313 | ||
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 | |
317 | ||
318 | ||
319 | This usage will initialise a new md array, associate some | |
320 | devices with it, and activate the array. | |
321 | ||
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%. | |
325 | ||
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 | |
328 | this caution. | |
329 | ||
330 | ||
331 | The General Management options that are valid with --cre- | |
332 | ate are: | |
333 | ||
334 | -\b--\b-r\bru\bun\bn insist of running the array even if some devices | |
335 | look like they might be in use. | |
336 | ||
337 | ||
338 | -\b--\b-r\bre\bea\bad\bdo\bon\bnl\bly\by | |
339 | start the array readonly - not supported yet. | |
340 | ||
341 | ||
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. | |
344 | ||
345 | ||
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. | |
350 | ||
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. | |
354 | ||
355 | ||
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. | |
358 | ||
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. | |
362 | ||
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. | |
367 | ||
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. | |
378 | ||
379 | ||
380 | ||
381 | F\bFI\bIL\bLE\bES\bS | |
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. | |
386 | ||
387 | ||
388 | /\b/e\bet\btc\bc/\b/m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf | |
389 | The config file lists which devices may be scanned to see | |
390 | if they contain MD super block, and gives identifying | |
391 | information (e.g. UUID) about known MD arrays. See | |
392 | m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf(5) for more details. | |
393 | ||
394 | ||
395 | ||
396 | T\bTO\bOD\bDO\bO | |
397 | Finish and document Follow mode. | |
398 | ||
399 | ||
400 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
401 | For information on the various levels of RAID, check out: | |
402 | ||
403 | ||
404 | http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/ | |
405 | ||
406 | for new releases of the RAID driver check out: | |
407 | ||
408 | ||
409 | ftp://ftp.kernel.org/pub/linux/kernel/peo- | |
410 | ple/mingo/raid-patches | |
411 | ||
412 | or | |
413 | ||
414 | http://www.cse.unsw.edu.au/~neilb/patches/linux- | |
415 | stable/ | |
416 | ||
417 | m\bmd\bda\bad\bdm\bm.\b.c\bco\bon\bnf\bf(5), m\bmd\bd(4). | |
418 | ||
419 | _\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) | |
420 | ||
421 | ||
422 | ||
423 | mdadm(8) |