-
Notifications
You must be signed in to change notification settings - Fork 14
/
mdadm.8.in
3379 lines (2962 loc) · 100 KB
/
mdadm.8.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" -*- nroff -*-
.\" Copyright Neil Brown and others.
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\" See file COPYING in distribution for details.
.TH MDADM 8 "" v4.4
.SH NAME
mdadm \- manage MD devices
.I aka
Linux Software RAID
.SH SYNOPSIS
.BI mdadm " [mode] <raiddevice> [options] <component-devices>"
.SH DESCRIPTION
RAID devices are virtual devices created from two or more
real block devices. This allows multiple devices (typically disk
drives or partitions thereof) to be combined into a single device to
hold (for example) a single filesystem.
Some RAID levels include redundancy and so can survive some degree of
device failure.
Linux Software RAID devices are implemented through the md (Multiple
Devices) device driver.
Currently, Linux supports
.B LINEAR
md devices,
.B RAID0
(striping),
.B RAID1
(mirroring),
.BR RAID4 ,
.BR RAID5 ,
.BR RAID6 ,
.BR RAID10 ,
.BR MULTIPATH ,
.BR FAULTY ,
and
.BR CONTAINER .
.B MULTIPATH
is not a Software RAID mechanism, but does involve
multiple devices:
each device is a path to one common physical storage device.
New installations should not use md/multipath as it is not well
supported and has no ongoing development. Use the Device Mapper based
multipath-tools instead. It is deprecated and support will be removed in the future.
.B FAULTY
is also not true RAID, and it only involves one device. It
provides a layer over a true device that can be used to inject faults. It is deprecated
and support will be removed in the future.
.B CONTAINER
is different again. A
.B CONTAINER
is a collection of devices that are
managed as a set. This is similar to the set of devices connected to
a hardware RAID controller. The set of devices may contain a number
of different RAID arrays each utilising some (or all) of the blocks from a
number of the devices in the set. For example, two devices in a 5-device set
might form a RAID1 using the whole devices. The remaining three might
have a RAID5 over the first half of each device, and a RAID0 over the
second half.
With a
.BR CONTAINER ,
there is one set of metadata that describes all of
the arrays in the container. So when
.I mdadm
creates a
.B CONTAINER
device, the device just represents the metadata. Other normal arrays (RAID1
etc) can be created inside the container.
.SH MODES
mdadm has several major modes of operation:
.TP
.B Assemble
Assemble the components of a previously created
array into an active array. Components can be explicitly given
or can be searched for.
.I mdadm
checks that the components
do form a bona fide array, and can, on request, fiddle superblock
information so as to assemble a faulty array.
.TP
.B Build
Build an array that doesn't have per-device metadata (superblocks). For these
sorts of arrays,
.I mdadm
cannot differentiate between initial creation and subsequent assembly
of an array. It also cannot perform any checks that appropriate
components have been requested. Because of this, the
.B Build
mode should only be used together with a complete understanding of
what you are doing.
.TP
.B Create
Create a new array with per-device metadata (superblocks).
Appropriate metadata is written to each device, and then the array
comprising those devices is activated. A 'resync' process is started
to make sure that the array is consistent (e.g. both sides of a mirror
contain the same data) but the content of the device is left otherwise
untouched.
The array can be used as soon as it has been created. There is no
need to wait for the initial resync to finish.
.TP
.B "Follow or Monitor"
Monitor one or more md devices and act on any state changes. This is
only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as
only these have interesting state. RAID0 or Linear never have
missing, spare, or failed drives, so there is nothing to monitor.
.TP
.B "Grow"
Grow (or shrink) an array, or otherwise reshape it in some way.
Currently supported growth options including changing the active size
of component devices and changing the number of active devices in
Linear and RAID levels 0/1/4/5/6,
changing the RAID level between 0, 1, 5, and 6, and between 0 and 10,
changing the chunk size and layout for RAID 0,4,5,6,10 as well as adding or
removing a write-intent bitmap and changing the array's consistency policy.
.TP
.B "Incremental Assembly"
Add a single device to an appropriate array. If the addition of the
device makes the array runnable, the array will be started.
This provides a convenient interface to a
.I hot-plug
system. As each device is detected,
.I mdadm
has a chance to include it in some array as appropriate.
Optionally, when the
.I \-\-fail
flag is passed in we will remove the device from any active array
instead of adding it.
If a
.B CONTAINER
is passed to
.I mdadm
in this mode, then any arrays within that container will be assembled
and started.
.TP
.B Manage
This is for doing things to specific components of an array such as
adding new spares and removing faulty devices.
.TP
.B Misc
This is an 'everything else' mode that supports operations on active
arrays, operations on component devices such as erasing old superblocks, and
information-gathering operations.
.\"This mode allows operations on independent devices such as examine MD
.\"superblocks, erasing old superblocks and stopping active arrays.
.TP
.B Auto-detect
This mode does not act on a specific device or array, but rather it
requests the Linux Kernel to activate any auto-detected arrays.
.SH OPTIONS
.SH Options for selecting a mode are:
.TP
.BR \-A ", " \-\-assemble
Assemble a pre-existing array.
.TP
.BR \-B ", " \-\-build
Build a legacy array without superblocks.
.TP
.BR \-C ", " \-\-create
Create a new array.
.TP
.BR \-F ", " \-\-follow ", " \-\-monitor
Select
.B Monitor
mode.
.TP
.BR \-G ", " \-\-grow
Change the size or shape of an active array.
.TP
.BR \-I ", " \-\-incremental
Add/remove a single device to/from an appropriate array, and possibly start the array.
.TP
.B \-\-auto-detect
Request that the kernel starts any auto-detected arrays. This can only
work if
.I md
is compiled into the kernel \(em not if it is a module.
Arrays can be auto-detected by the kernel if all the components are in
primary MS-DOS partitions with partition type
.BR FD ,
and all use v0.90 metadata.
In-kernel autodetect is not recommended for new installations. Using
.I mdadm
to detect and assemble arrays \(em possibly in an
.I initrd
\(em is substantially more flexible and should be preferred.
.P
If a device is given before any options, or if the first option is
one of
.BR \-\-add ,
.BR \-\-re\-add ,
.BR \-\-add\-spare ,
.BR \-\-fail ,
.BR \-\-remove ,
or
.BR \-\-replace ,
then the MANAGE mode is assumed.
Anything other than these will cause the
.B Misc
mode to be assumed.
.SH Options that are not mode-specific are:
.TP
.BR \-h ", " \-\-help
Display a general help message or, after one of the above options, a
mode-specific help message.
.TP
.B \-\-help\-options
Display more detailed help about command-line parsing and some commonly
used options.
.TP
.BR \-V ", " \-\-version
Print version information for mdadm.
.TP
.BR \-v ", " \-\-verbose
Be more verbose about what is happening. This can be used twice to be
extra-verbose.
The extra verbosity currently only affects
.B \-\-detail \-\-scan
and
.BR "\-\-examine \-\-scan" .
.TP
.BR \-q ", " \-\-quiet
Avoid printing purely informative messages. With this,
.I mdadm
will be silent unless there is something really important to report.
.TP
.BR \-f ", " \-\-force
Be more forceful about certain operations. See the various modes for
the exact meaning of this option in different contexts.
.TP
.BR \-c ", " \-\-config=
Specify the config file or directory. If not specified, the default config file
and default conf.d directory will be used. See
.BR mdadm.conf (5)
for more details.
If the config file given is
.B "partitions"
then nothing will be read, but
.I mdadm
will act as though the config file contained exactly
.br
.B " DEVICE partitions containers"
.br
and will read
.B /proc/partitions
to find a list of devices to scan, and
.B /proc/mdstat
to find a list of containers to examine.
If the word
.B "none"
is given for the config file, then
.I mdadm
will act as though the config file were empty.
If the name given is of a directory, then
.I mdadm
will collect all the files contained in the directory with a name ending
in
.BR .conf ,
sort them lexically, and process all of those files as config files.
.TP
.BR \-s ", " \-\-scan
Scan config file or
.B /proc/mdstat
for missing information.
In general, this option gives
.I mdadm
permission to get any missing information (like component devices,
array devices, array identities, and alert destination) from the
configuration file (see previous option);
one exception is MISC mode when using
.B \-\-detail
or
.B \-\-stop,
in which case
.B \-\-scan
says to get a list of array devices from
.BR /proc/mdstat .
.TP
.BR \-e ", " \-\-metadata=
Declare the style of RAID metadata (superblock) to be used. The
default is {DEFAULT_METADATA} for
.BR \-\-create ,
and to guess for other operations.
The default can be overridden by setting the
.B metadata
value for the
.B CREATE
keyword in
.BR mdadm.conf .
Options are:
.RS
.ie '{DEFAULT_METADATA}'0.90'
.IP "0, 0.90, default"
.el
.IP "0, 0.90"
Use the original 0.90 format superblock. This format limits arrays to
28 component devices and limits component devices of levels 1 and
greater to 2 terabytes. It is also possible for there to be confusion
about whether the superblock applies to a whole device or just the
last partition, if that partition starts on a 64K boundary.
.ie '{DEFAULT_METADATA}'0.90'
.IP "1, 1.0, 1.1, 1.2"
.el
.IP "1, 1.0, 1.1, 1.2 default"
Use the new version-1 format superblock. This has fewer restrictions.
It can easily be moved between hosts with different endian-ness, and a
recovery operation can be checkpointed and restarted. The different
sub-versions store the superblock at different locations on the
device, either at the end (for 1.0), at the start (for 1.1) or 4K from
the start (for 1.2). "1" is equivalent to "1.2" (the commonly
preferred 1.x format).
'if '{DEFAULT_METADATA}'1.2' "default" is equivalent to "1.2".
.IP ddf
Use the "Industry Standard" DDF (Disk Data Format) format defined by
SNIA. DDF is deprecated and there is no active development around it.
When creating a DDF array a
.B CONTAINER
will be created, and normal arrays can be created in that container.
.IP imsm
Use the Intel(R) Matrix Storage Manager metadata format. This creates a
.B CONTAINER
which is managed in a similar manner to DDF, and is supported by an
option-rom on some platforms:
.IP
.B https://www.intel.com/content/www/us/en/support/products/122484
.PP
.RE
.TP
.B \-\-homehost=
This will override any
.B HOMEHOST
setting in the config file and provides the identity of the host which
should be considered the home for any arrays.
When creating an array, the
.B homehost
will be recorded in the metadata. For version-1 superblocks, it will
be prefixed to the array name. For version-0.90 superblocks, part of
the SHA1 hash of the hostname will be stored in the latter half of the
UUID.
When reporting information about an array, any array which is tagged
for the given homehost will be reported as such.
When using Auto-Assemble, only arrays tagged for the given homehost
will be allowed to use 'local' names (i.e. not ending in '_' followed
by a digit string). See below under
.BR "Auto-Assembly" .
The special name "\fBany\fP" can be used as a wild card. If an array
is created with
.B --homehost=any
then the name "\fBany\fP" will be stored in the array and it can be
assembled in the same way on any host. If an array is assembled with
this option, then the homehost recorded on the array will be ignored.
.TP
.B \-\-prefer=
When
.I mdadm
needs to print the name for a device it normally finds the name in
.B /dev
which refers to the device and is the shortest. When a path component is
given with
.B \-\-prefer
.I mdadm
will prefer a longer name if it contains that component. For example
.B \-\-prefer=by-uuid
will prefer a name in a subdirectory of
.B /dev
called
.BR by-uuid .
This functionality is currently only provided by
.B \-\-detail
and
.BR \-\-monitor .
.TP
.B \-\-home\-cluster=
specifies the cluster name for the md device. The md device can be assembled
only on the cluster which matches the name specified. If this option is not
provided, mdadm tries to detect the cluster name automatically.
.SH For create, build, or grow:
.TP
.BR \-n ", " \-\-raid\-devices=
Specify the number of active devices in the array. This, plus the
number of spare devices (see below) must equal the number of
.I component-devices
(including "\fBmissing\fP" devices)
that are listed on the command line for
.BR \-\-create .
Setting a value of 1 is probably
a mistake and so requires that
.B \-\-force
be specified first. A value of 1 will then be allowed for linear,
multipath, RAID0 and RAID1. It is never allowed for RAID4, RAID5 or RAID6.
.br
This number can only be changed using
.B \-\-grow
for RAID1, RAID4, RAID5 and RAID6 arrays.
.TP
.BR \-x ", " \-\-spare\-devices=
Specify the number of spare (eXtra) devices in the initial array.
Spares can also be added
and removed later. The number of component devices listed
on the command line must equal the number of RAID devices plus the
number of spare devices.
.TP
.BR \-z ", " \-\-size=
Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6/10
and for RAID 0 on external metadata.
This must be a multiple of the chunk size, and must leave about 128Kb
of space at the end of the drive for the RAID superblock.
If this is not specified
(as it normally is not) the smallest drive (or partition) sets the
size, though if there is a variance among the drives of greater than 1%, a warning is
issued.
A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
Megabytes, Gigabytes or Terabytes respectively.
Sometimes a replacement drive can be a little smaller than the
original drives though this should be minimised by IDEMA standards.
Such a replacement drive will be rejected by
.IR md .
To guard against this it can be useful to set the initial size
slightly smaller than the smaller device with the aim that it will
still be larger than any replacement.
This option can be used with
.B \-\-create
for determining the initial size of an array. For external metadata,
it can be used on a volume, but not on a container itself.
Setting the initial size of
.B RAID 0
array is only valid for external metadata.
This value can be set with
.B \-\-grow
for RAID level 1/4/5/6/10 though
DDF arrays may not be able to support this.
RAID 0 array size cannot be changed.
If the array was created with a size smaller than the currently
active drives, the extra space can be accessed using
.BR \-\-grow .
The size can be given as
.B max
which means to choose the largest size that fits on all current drives.
Before reducing the size of the array (with
.BR "\-\-grow \-\-size=" )
you should make sure that space isn't needed. If the device holds a
filesystem, you would need to resize the filesystem to use less space.
After reducing the array size you should check that the data stored in
the device is still available. If the device holds a filesystem, then
an 'fsck' of the filesystem is a minimum requirement. If there are
problems the array can be made bigger again with no loss with another
.B "\-\-grow \-\-size="
command.
.TP
.BR \-Z ", " \-\-array\-size=
This is only meaningful with
.B \-\-grow
and its effect is not persistent: when the array is stopped and
restarted the default array size will be restored.
Setting the array-size causes the array to appear smaller to programs
that access the data. This is particularly needed before reshaping an
array so that it will be smaller. As the reshape is not reversible,
but setting the size with
.B \-\-array-size
is, it is required that the array size is reduced as appropriate
before the number of devices in the array is reduced.
Before reducing the size of the array you should make sure that space
isn't needed. If the device holds a filesystem, you would need to
resize the filesystem to use less space.
After reducing the array size you should check that the data stored in
the device is still available. If the device holds a filesystem, then
an 'fsck' of the filesystem is a minimum requirement. If there are
problems the array can be made bigger again with no loss with another
.B "\-\-grow \-\-array\-size="
command.
A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
Megabytes, Gigabytes or Terabytes respectively.
A value of
.B max
restores the apparent size of the array to be whatever the real
amount of available space is.
Clustered arrays do not support this parameter yet.
.TP
.BR \-c ", " \-\-chunk=
Specify chunk size in kilobytes. The default when creating an
array is 512KB. To ensure compatibility with earlier versions, the
default when building an array with no persistent metadata is 64KB.
This is only meaningful for RAID0, RAID4, RAID5, RAID6, and RAID10.
RAID4, RAID5, RAID6, and RAID10 require the chunk size to be a power
of 2, with minimal chunk size being 4KB.
A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
Megabytes, Gigabytes or Terabytes respectively.
.TP
.BR \-\-rounding=
Specify the rounding factor for a Linear array. The size of each
component will be rounded down to a multiple of this size.
This is a synonym for
.B \-\-chunk
but highlights the different meaning for Linear as compared to other
RAID levels. The default is 0K (i.e. no rounding).
.TP
.BR \-l ", " \-\-level=
Set RAID level. When used with
.BR \-\-create ,
options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4,
raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty, container.
Obviously some of these are synonymous.
When a
.B CONTAINER
metadata type is requested, only the
.B container
level is permitted, and it does not need to be explicitly given.
When used with
.BR \-\-build ,
only linear, stripe, raid0, 0, raid1, multipath, mp, and faulty are valid.
Can be used with
.B \-\-grow
to change the RAID level in some cases. See LEVEL CHANGES below.
.TP
.BR \-p ", " \-\-layout=
This option configures the fine details of data layout for RAID5, RAID6,
and RAID10 arrays, and controls the failure modes for
.IR faulty .
It can also be used for working around a kernel bug with RAID0, but generally
doesn't need to be used explicitly.
The layout of the RAID5 parity block can be one of
.BR left\-asymmetric ,
.BR left\-symmetric ,
.BR right\-asymmetric ,
.BR right\-symmetric ,
.BR la ", " ra ", " ls ", " rs .
The default is
.BR left\-symmetric .
It is also possible to cause RAID5 to use a RAID4-like layout by
choosing
.BR parity\-first ,
or
.BR parity\-last .
Finally for RAID5 there are DDF\-compatible layouts,
.BR ddf\-zero\-restart ,
.BR ddf\-N\-restart ,
and
.BR ddf\-N\-continue .
These same layouts are available for RAID6. There are also 4 layouts
that will provide an intermediate stage for converting between RAID5
and RAID6. These provide a layout which is identical to the
corresponding RAID5 layout on the first N\-1 devices, and has the 'Q'
syndrome (the second 'parity' block used by RAID6) on the last device.
These layouts are:
.BR left\-symmetric\-6 ,
.BR right\-symmetric\-6 ,
.BR left\-asymmetric\-6 ,
.BR right\-asymmetric\-6 ,
and
.BR parity\-first\-6 .
When setting the failure mode for level
.I faulty,
the options are:
.BR write\-transient ", " wt ,
.BR read\-transient ", " rt ,
.BR write\-persistent ", " wp ,
.BR read\-persistent ", " rp ,
.BR write\-all ,
.BR read\-fixable ", " rf ,
.BR clear ", " flush ", " none .
Each failure mode can be followed by a number, which is used as a period
between fault generation. Without a number, the fault is generated
once on the first relevant request. With a number, the fault will be
generated after that many requests, and will continue to be generated
every time the period elapses.
Multiple failure modes can be current simultaneously by using the
.B \-\-grow
option to set subsequent failure modes.
"clear" or "none" will remove any pending or periodic failure modes,
and "flush" will clear any persistent faults.
The layout options for RAID10 are one of 'n', 'o' or 'f' followed
by a small number signifying the number of copies of each datablock.
The default is 'n2'. The supported options are:
.I 'n'
signals 'near' copies. Multiple copies of one data block are at
similar offsets in different devices.
.I 'o'
signals 'offset' copies. Rather than the chunks being duplicated
within a stripe, whole stripes are duplicated but are rotated by one
device so duplicate blocks are on different devices. Thus subsequent
copies of a block are in the next drive, and are one chunk further
down.
.I 'f'
signals 'far' copies
(multiple copies have very different offsets).
See md(4) for more detail about 'near', 'offset', and 'far'.
As for the number of copies of each data block, 2 is normal, 3
can be useful. This number can be at most equal to the number of
devices in the array. It does not need to divide evenly into that
number (e.g. it is perfectly legal to have an 'n2' layout for an array
with an odd number of devices).
A bug introduced in Linux 3.14 means that RAID0 arrays
.B "with devices of differing sizes"
started using a different layout. This could lead to
data corruption. Since Linux 5.4 (and various stable releases that received
backports), the kernel will not accept such an array unless
a layout is explicitly set. It can be set to
.RB ' original '
or
.RB ' alternate '.
When creating a new array,
.I mdadm
will select
.RB ' original '
by default, so the layout does not normally need to be set.
An array created for either
.RB ' original '
or
.RB ' alternate '
will not be recognized by an (unpatched) kernel prior to 5.4. To create
a RAID0 array with devices of differing sizes that can be used on an
older kernel, you can set the layout to
.RB ' dangerous '.
This will use whichever layout the running kernel supports, so the data
on the array may become corrupt when changing kernel from pre-3.14 to a
later kernel.
When an array is converted between RAID5 and RAID6 an intermediate
RAID6 layout is used in which the second parity block (Q) is always on
the last device. To convert a RAID5 to RAID6 and leave it in this new
layout (which does not require re-striping) use
.BR \-\-layout=preserve .
This will try to avoid any restriping.
The converse of this is
.B \-\-layout=normalise
which will change a non-standard RAID6 layout into a more standard
arrangement.
.TP
.BR \-\-parity=
same as
.B \-\-layout
(thus explaining the p of
.BR \-p ).
.TP
.BR \-b ", " \-\-bitmap=
Specify how to store a write-intent bitmap. Following values are supported:
.B internal
- the bitmap is stored with the metadata on the array and so is replicated on all devices.
.B clustered
- the array is created for a clustered environment. One bitmap is created for each node as defined
by the
.B \-\-nodes
parameter and are stored internally.
.B none
- create array with no bitmap or remove any present bitmap (grow mode).
Setting bitmap for file is deprecated and should not be used. The file should not exist unless
.B \-\-force
is also given. The same file should be provided when assembling the array. The file name must
contain at least one slash ('/'). Bitmap files are only known to work on ext2 and ext3. Storing
bitmap files on other filesystems may result in serious problems.
When creating an array on devices which are 100G or larger,
.I mdadm
automatically adds an internal bitmap as it will usually be
beneficial. This can be suppressed with
.B "\-\-bitmap=none"
or by selecting a different consistency policy with
.BR \-\-consistency\-policy .
.TP
.BR \-\-bitmap\-chunk=
Set the chunk size of the bitmap. Each bit corresponds to that many
Kilobytes of storage.
When using a file-based bitmap, the default is to use the smallest
size that is at least 4 and requires no more than 2^21 chunks.
When using an
.B internal
bitmap, the chunk size defaults to 64Meg, or larger if necessary to
fit the bitmap into the available space.
A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
Megabytes, Gigabytes or Terabytes respectively.
.TP
.BR \-W ", " \-\-write\-mostly
subsequent devices listed in a
.BR \-\-build ,
.BR \-\-create ,
or
.B \-\-add
command will be flagged as 'write\-mostly'. This is valid for RAID1
only and means that the 'md' driver will avoid reading from these
devices if at all possible. This can be useful if mirroring over a
slow link.
.TP
.BR \-\-write\-behind=
Specify that write-behind mode should be enabled (valid for RAID1
only). If an argument is specified, it will set the maximum number
of outstanding writes allowed. The default value is 256.
A write-intent bitmap is required in order to use write-behind
mode, and write-behind is only attempted on drives marked as
.IR write-mostly .
.TP
.BR \-\-failfast
subsequent devices listed in a
.B \-\-create
or
.B \-\-add
command will be flagged as 'failfast'. This is valid for RAID1 and
RAID10 only. IO requests to these devices will be encouraged to fail
quickly rather than cause long delays due to error handling. Also no
attempt is made to repair a read error on these devices.
If an array becomes degraded so that the 'failfast' device is the only
usable device, the 'failfast' flag will then be ignored and extended
delays will be preferred to complete failure.
The 'failfast' flag is appropriate for storage arrays which have a
low probability of true failure, but which may sometimes
cause unacceptable delays due to internal maintenance functions.
.TP
.BR \-\-assume\-clean
Tell
.I mdadm
that the array pre-existed and is known to be clean. It can be useful
when trying to recover from a major failure as you can be sure that no
data will be affected unless you actually write to the array. It can
also be used when creating a RAID1 or RAID10 if you want to avoid the
initial resync, however this practice \(em while normally safe \(em is not
recommended. Use this only if you really know what you are doing.
.IP
When the devices that will be part of a new array were filled
with zeros before creation the operator knows the array is
actually clean. If that is the case, such as after running
badblocks, this argument can be used to tell mdadm the
facts the operator knows.
.IP
When an array is resized to a larger size with
.B "\-\-grow \-\-size="
the new space is normally resynced in that same way that the whole
array is resynced at creation.
.B \-\-assume\-clean
can be used with that command to avoid the automatic resync.
.TP
.BR \-\-write-zeroes
When creating an array, send write zeroes requests to all the block
devices. This should zero the data area on all disks such that the
initial sync is not necessary and, if successful, will behave as if
.B \-\-assume\-clean
was specified.
.IP
This is intended for use with devices that have hardware offload for
zeroing, but despite this zeroing can still take several minutes for
large disks. Thus a message is printed before and after zeroing and
each disk is zeroed in parallel with the others.
.IP
This is only meaningful with --create.
.TP
.BR \-\-backup\-file=
This is needed when
.B \-\-grow
is used to increase the number of raid devices in a RAID5 or RAID6 if
there are no spare devices available, or to shrink, change RAID level
or layout. See the GROW MODE section below on RAID\-DEVICES CHANGES.
The file must be stored on a separate device, not on the RAID array
being reshaped.
.TP
.B \-\-data\-offset=
Arrays with 1.x metadata can leave a gap between the start of the
device and the start of array data. This gap can be used for various
metadata. The start of data is known as the
.IR data\-offset .
Normally an appropriate data offset is computed automatically.
However it can be useful to set it explicitly such as when re-creating
an array which was originally created using a different version of
.I mdadm
which computed a different offset.
Setting the offset explicitly over-rides the default. The value given
is in Kilobytes unless a suffix of 'K', 'M', 'G' or 'T' is used to explicitly
indicate Kilobytes, Megabytes, Gigabytes or Terabytes respectively.
.B \-\-data\-offset
can also be used with
.B --grow
for some RAID levels (initially on RAID10). This allows the
data\-offset to be changed as part of the reshape process. When the
data offset is changed, no backup file is required as the difference
in offsets is used to provide the same functionality.
When the new offset is earlier than the old offset, the number of
devices in the array cannot shrink. When it is after the old offset,
the number of devices in the array cannot increase.
When creating an array,
.B \-\-data\-offset
can be specified as
.BR variable .
In the case each member device is expected to have an offset appended
to the name, separated by a colon. This makes it possible to recreate
exactly an array which has varying data offsets (as can happen when
different versions of
.I mdadm
are used to add different devices).
.TP
.BR \-\-continue
This option is complementary to the
.B \-\-freeze-reshape
option for assembly. It is needed when
.B \-\-grow
operation is interrupted and it is not restarted automatically due to
.B \-\-freeze-reshape
usage during array assembly. This option is used together with
.BR \-G
, (
.BR \-\-grow
) command and device for a pending reshape to be continued.
All parameters required for reshape continuation will be read from array metadata.
If initial
.BR \-\-grow
command had required
.BR \-\-backup\-file=
option to be set, continuation option will require to have exactly the same
backup file given as well.
.IP
Any other parameter passed together with
.BR \-\-continue
option will be ignored.
.TP
.BR \-N ", " \-\-name=
Set a
.B name
for the array. It must be
.BR "POSIX PORTABLE NAME"
compatible and cannot be longer than 32 chars. This is effective when creating an array
with a v1 metadata, or an external array.
If name is needed but not specified, it is taken from the basename of the device
that is being created. See
.BR "DEVICE NAMES"
.TP
.BR \-R ", " \-\-run
Insist that
.I mdadm
run the array, even if some of the components
appear to be active in another array or filesystem. Normally
.I mdadm
will ask for confirmation before including such components in an
array. This option causes that question to be suppressed.
.TP
.BR \-f ", " \-\-force
Insist that
.I mdadm
accept the geometry and layout specified without question. Normally
.I mdadm
will not allow the creation of an array with only one device, and will try
to create a RAID5 array with one missing drive (as this makes the
initial resync work faster). With
.BR \-\-force ,
.I mdadm
will not try to be so clever.
.TP
.BR \-o ", " \-\-readonly
Start the array
.B read only
rather than read-write as normal. No writes will be allowed to the
array, and no resync, recovery, or reshape will be started. It works with
Create, Assemble, Manage and Misc mode.
.TP
.BR \-a ", " "\-\-add"
This option can be used in Grow mode in two cases.
If the target array is a Linear array, then
.B \-\-add
can be used to add one or more devices to the array. They
are simply catenated on to the end of the array. Once added, the
devices cannot be removed.
If the
.B \-\-raid\-disks
option is being used to increase the number of devices in an array,
then
.B \-\-add
can be used to add some extra devices to be included in the array.
In most cases this is not needed as the extra devices can be added as
spares first, and then the number of raid disks can be changed.
However, for RAID0 it is not possible to add spares. So to increase
the number of devices in a RAID0, it is necessary to set the new
number of devices, and to add the new devices, in the same command.
.TP
.BR \-\-nodes
Only works when the array is created for a clustered environment. It specifies
the maximum number of nodes in the cluster that will use this device
simultaneously. If not specified, this defaults to 4.
.TP
.BR \-\-write-journal
Specify journal device for the RAID-4/5/6 array. The journal device
should be an SSD with a reasonable lifetime.