2 .\" Copyright Neil Brown and others.
3 .\" This program is free software; you can redistribute it and/or modify
4 .\" it under the terms of the GNU General Public License as published by
5 .\" the Free Software Foundation; either version 2 of the License, or
6 .\" (at your option) any later version.
7 .\" See file COPYING in distribution for details.
10 mdadm \- manage MD devices
16 .BI mdadm " [mode] <raiddevice> [options] <component-devices>"
19 RAID devices are virtual devices created from two or more
20 real block devices. This allows multiple devices (typically disk
21 drives or partitions thereof) to be combined into a single device to
22 hold (for example) a single filesystem.
23 Some RAID levels include redundancy and so can survive some degree of
26 Linux Software RAID devices are implemented through the md (Multiple
27 Devices) device driver.
29 Currently, Linux supports
46 is not a Software RAID mechanism, but does involve
48 each device is a path to one common physical storage device.
49 New installations should not use md/multipath as it is not well
50 supported and has no ongoing development. Use the Device Mapper based
51 multipath-tools instead. It is deprecated and support will be removed in the future.
54 is also not true RAID, and it only involves one device. It
55 provides a layer over a true device that can be used to inject faults. It is deprecated
56 and support will be removed in the future.
61 is a collection of devices that are
62 managed as a set. This is similar to the set of devices connected to
63 a hardware RAID controller. The set of devices may contain a number
64 of different RAID arrays each utilising some (or all) of the blocks from a
65 number of the devices in the set. For example, two devices in a 5-device set
66 might form a RAID1 using the whole devices. The remaining three might
67 have a RAID5 over the first half of each device, and a RAID0 over the
72 there is one set of metadata that describes all of
73 the arrays in the container. So when
77 device, the device just represents the metadata. Other normal arrays (RAID1
78 etc) can be created inside the container.
81 mdadm has several major modes of operation:
84 Assemble the components of a previously created
85 array into an active array. Components can be explicitly given
86 or can be searched for.
88 checks that the components
89 do form a bona fide array, and can, on request, fiddle superblock
90 information so as to assemble a faulty array.
94 Build an array that doesn't have per-device metadata (superblocks). For these
97 cannot differentiate between initial creation and subsequent assembly
98 of an array. It also cannot perform any checks that appropriate
99 components have been requested. Because of this, the
101 mode should only be used together with a complete understanding of
106 Create a new array with per-device metadata (superblocks).
107 Appropriate metadata is written to each device, and then the array
108 comprising those devices is activated. A 'resync' process is started
109 to make sure that the array is consistent (e.g. both sides of a mirror
110 contain the same data) but the content of the device is left otherwise
112 The array can be used as soon as it has been created. There is no
113 need to wait for the initial resync to finish.
116 .B "Follow or Monitor"
117 Monitor one or more md devices and act on any state changes. This is
118 only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as
119 only these have interesting state. RAID0 or Linear never have
120 missing, spare, or failed drives, so there is nothing to monitor.
124 Grow (or shrink) an array, or otherwise reshape it in some way.
125 Currently supported growth options including changing the active size
126 of component devices and changing the number of active devices in
127 Linear and RAID levels 0/1/4/5/6,
128 changing the RAID level between 0, 1, 5, and 6, and between 0 and 10,
129 changing the chunk size and layout for RAID 0,4,5,6,10 as well as adding or
130 removing a write-intent bitmap and changing the array's consistency policy.
133 .B "Incremental Assembly"
134 Add a single device to an appropriate array. If the addition of the
135 device makes the array runnable, the array will be started.
136 This provides a convenient interface to a
138 system. As each device is detected,
140 has a chance to include it in some array as appropriate.
143 flag is passed in we will remove the device from any active array
144 instead of adding it.
150 in this mode, then any arrays within that container will be assembled
155 This is for doing things to specific components of an array such as
156 adding new spares and removing faulty devices.
160 This is an 'everything else' mode that supports operations on active
161 arrays, operations on component devices such as erasing old superblocks, and
162 information-gathering operations.
163 .\"This mode allows operations on independent devices such as examine MD
164 .\"superblocks, erasing old superblocks and stopping active arrays.
168 This mode does not act on a specific device or array, but rather it
169 requests the Linux Kernel to activate any auto-detected arrays.
172 .SH Options for selecting a mode are:
175 .BR \-A ", " \-\-assemble
176 Assemble a pre-existing array.
179 .BR \-B ", " \-\-build
180 Build a legacy array without superblocks.
183 .BR \-C ", " \-\-create
187 .BR \-F ", " \-\-follow ", " \-\-monitor
193 .BR \-G ", " \-\-grow
194 Change the size or shape of an active array.
197 .BR \-I ", " \-\-incremental
198 Add/remove a single device to/from an appropriate array, and possibly start the array.
202 Request that the kernel starts any auto-detected arrays. This can only
205 is compiled into the kernel \(em not if it is a module.
206 Arrays can be auto-detected by the kernel if all the components are in
207 primary MS-DOS partitions with partition type
209 and all use v0.90 metadata.
210 In-kernel autodetect is not recommended for new installations. Using
212 to detect and assemble arrays \(em possibly in an
214 \(em is substantially more flexible and should be preferred.
217 If a device is given before any options, or if the first option is
226 then the MANAGE mode is assumed.
227 Anything other than these will cause the
231 .SH Options that are not mode-specific are:
234 .BR \-h ", " \-\-help
235 Display a general help message or, after one of the above options, a
236 mode-specific help message.
240 Display more detailed help about command-line parsing and some commonly
244 .BR \-V ", " \-\-version
245 Print version information for mdadm.
248 .BR \-v ", " \-\-verbose
249 Be more verbose about what is happening. This can be used twice to be
251 The extra verbosity currently only affects
252 .B \-\-detail \-\-scan
254 .BR "\-\-examine \-\-scan" .
257 .BR \-q ", " \-\-quiet
258 Avoid printing purely informative messages. With this,
260 will be silent unless there is something really important to report.
264 .BR \-f ", " \-\-force
265 Be more forceful about certain operations. See the various modes for
266 the exact meaning of this option in different contexts.
269 .BR \-c ", " \-\-config=
270 Specify the config file or directory. If not specified, the default config file
271 and default conf.d directory will be used. See
275 If the config file given is
277 then nothing will be read, but
279 will act as though the config file contained exactly
281 .B " DEVICE partitions containers"
285 to find a list of devices to scan, and
287 to find a list of containers to examine.
290 is given for the config file, then
292 will act as though the config file were empty.
294 If the name given is of a directory, then
296 will collect all the files contained in the directory with a name ending
299 sort them lexically, and process all of those files as config files.
302 .BR \-s ", " \-\-scan
305 for missing information.
306 In general, this option gives
308 permission to get any missing information (like component devices,
309 array devices, array identities, and alert destination) from the
310 configuration file (see previous option);
311 one exception is MISC mode when using
317 says to get a list of array devices from
321 .BR \-e ", " \-\-metadata=
322 Declare the style of RAID metadata (superblock) to be used. The
323 default is {DEFAULT_METADATA} for
325 and to guess for other operations.
326 The default can be overridden by setting the
335 .ie '{DEFAULT_METADATA}'0.90'
336 .IP "0, 0.90, default"
339 Use the original 0.90 format superblock. This format limits arrays to
340 28 component devices and limits component devices of levels 1 and
341 greater to 2 terabytes. It is also possible for there to be confusion
342 about whether the superblock applies to a whole device or just the
343 last partition, if that partition starts on a 64K boundary.
344 .ie '{DEFAULT_METADATA}'0.90'
345 .IP "1, 1.0, 1.1, 1.2"
347 .IP "1, 1.0, 1.1, 1.2 default"
348 Use the new version-1 format superblock. This has fewer restrictions.
349 It can easily be moved between hosts with different endian-ness, and a
350 recovery operation can be checkpointed and restarted. The different
351 sub-versions store the superblock at different locations on the
352 device, either at the end (for 1.0), at the start (for 1.1) or 4K from
353 the start (for 1.2). "1" is equivalent to "1.2" (the commonly
354 preferred 1.x format).
355 'if '{DEFAULT_METADATA}'1.2' "default" is equivalent to "1.2".
357 Use the "Industry Standard" DDF (Disk Data Format) format defined by
358 SNIA. DDF is deprecated and there is no active development around it.
359 When creating a DDF array a
361 will be created, and normal arrays can be created in that container.
363 Use the Intel(R) Matrix Storage Manager metadata format. This creates a
365 which is managed in a similar manner to DDF, and is supported by an
366 option-rom on some platforms:
368 .B https://www.intel.com/content/www/us/en/support/products/122484
374 This will override any
376 setting in the config file and provides the identity of the host which
377 should be considered the home for any arrays.
379 When creating an array, the
381 will be recorded in the metadata. For version-1 superblocks, it will
382 be prefixed to the array name. For version-0.90 superblocks, part of
383 the SHA1 hash of the hostname will be stored in the latter half of the
386 When reporting information about an array, any array which is tagged
387 for the given homehost will be reported as such.
389 When using Auto-Assemble, only arrays tagged for the given homehost
390 will be allowed to use 'local' names (i.e. not ending in '_' followed
391 by a digit string). See below under
392 .BR "Auto-Assembly" .
394 The special name "\fBany\fP" can be used as a wild card. If an array
397 then the name "\fBany\fP" will be stored in the array and it can be
398 assembled in the same way on any host. If an array is assembled with
399 this option, then the homehost recorded on the array will be ignored.
405 needs to print the name for a device it normally finds the name in
407 which refers to the device and is the shortest. When a path component is
411 will prefer a longer name if it contains that component. For example
412 .B \-\-prefer=by-uuid
413 will prefer a name in a subdirectory of
418 This functionality is currently only provided by
424 .B \-\-home\-cluster=
425 specifies the cluster name for the md device. The md device can be assembled
426 only on the cluster which matches the name specified. If this option is not
427 provided, mdadm tries to detect the cluster name automatically.
429 .SH For create, build, or grow:
432 .BR \-n ", " \-\-raid\-devices=
433 Specify the number of active devices in the array. This, plus the
434 number of spare devices (see below) must equal the number of
436 (including "\fBmissing\fP" devices)
437 that are listed on the command line for
439 Setting a value of 1 is probably
440 a mistake and so requires that
442 be specified first. A value of 1 will then be allowed for linear,
443 multipath, RAID0 and RAID1. It is never allowed for RAID4, RAID5 or RAID6.
445 This number can only be changed using
447 for RAID1, RAID4, RAID5 and RAID6 arrays.
450 .BR \-x ", " \-\-spare\-devices=
451 Specify the number of spare (eXtra) devices in the initial array.
452 Spares can also be added
453 and removed later. The number of component devices listed
454 on the command line must equal the number of RAID devices plus the
455 number of spare devices.
458 .BR \-z ", " \-\-size=
459 Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6/10
460 and for RAID 0 on external metadata.
461 This must be a multiple of the chunk size, and must leave about 128Kb
462 of space at the end of the drive for the RAID superblock.
463 If this is not specified
464 (as it normally is not) the smallest drive (or partition) sets the
465 size, though if there is a variance among the drives of greater than 1%, a warning is
468 A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
469 Megabytes, Gigabytes or Terabytes respectively.
471 Sometimes a replacement drive can be a little smaller than the
472 original drives though this should be minimised by IDEMA standards.
473 Such a replacement drive will be rejected by
475 To guard against this it can be useful to set the initial size
476 slightly smaller than the smaller device with the aim that it will
477 still be larger than any replacement.
479 This option can be used with
481 for determining the initial size of an array. For external metadata,
482 it can be used on a volume, but not on a container itself.
483 Setting the initial size of
485 array is only valid for external metadata.
487 This value can be set with
489 for RAID level 1/4/5/6/10 though
490 DDF arrays may not be able to support this.
491 RAID 0 array size cannot be changed.
492 If the array was created with a size smaller than the currently
493 active drives, the extra space can be accessed using
495 The size can be given as
497 which means to choose the largest size that fits on all current drives.
499 Before reducing the size of the array (with
500 .BR "\-\-grow \-\-size=" )
501 you should make sure that space isn't needed. If the device holds a
502 filesystem, you would need to resize the filesystem to use less space.
504 After reducing the array size you should check that the data stored in
505 the device is still available. If the device holds a filesystem, then
506 an 'fsck' of the filesystem is a minimum requirement. If there are
507 problems the array can be made bigger again with no loss with another
508 .B "\-\-grow \-\-size="
512 .BR \-Z ", " \-\-array\-size=
513 This is only meaningful with
515 and its effect is not persistent: when the array is stopped and
516 restarted the default array size will be restored.
518 Setting the array-size causes the array to appear smaller to programs
519 that access the data. This is particularly needed before reshaping an
520 array so that it will be smaller. As the reshape is not reversible,
521 but setting the size with
523 is, it is required that the array size is reduced as appropriate
524 before the number of devices in the array is reduced.
526 Before reducing the size of the array you should make sure that space
527 isn't needed. If the device holds a filesystem, you would need to
528 resize the filesystem to use less space.
530 After reducing the array size you should check that the data stored in
531 the device is still available. If the device holds a filesystem, then
532 an 'fsck' of the filesystem is a minimum requirement. If there are
533 problems the array can be made bigger again with no loss with another
534 .B "\-\-grow \-\-array\-size="
537 A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
538 Megabytes, Gigabytes or Terabytes respectively.
541 restores the apparent size of the array to be whatever the real
542 amount of available space is.
544 Clustered arrays do not support this parameter yet.
547 .BR \-c ", " \-\-chunk=
548 Specify chunk size in kilobytes. The default when creating an
549 array is 512KB. To ensure compatibility with earlier versions, the
550 default when building an array with no persistent metadata is 64KB.
551 This is only meaningful for RAID0, RAID4, RAID5, RAID6, and RAID10.
553 RAID4, RAID5, RAID6, and RAID10 require the chunk size to be a power
554 of 2, with minimal chunk size being 4KB.
556 A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
557 Megabytes, Gigabytes or Terabytes respectively.
561 Specify the rounding factor for a Linear array. The size of each
562 component will be rounded down to a multiple of this size.
563 This is a synonym for
565 but highlights the different meaning for Linear as compared to other
566 RAID levels. The default is 0K (i.e. no rounding).
569 .BR \-l ", " \-\-level=
570 Set RAID level. When used with
572 options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4,
573 raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty, container.
574 Obviously some of these are synonymous.
578 metadata type is requested, only the
580 level is permitted, and it does not need to be explicitly given.
584 only linear, stripe, raid0, 0, raid1, multipath, mp, and faulty are valid.
588 to change the RAID level in some cases. See LEVEL CHANGES below.
591 .BR \-p ", " \-\-layout=
592 This option configures the fine details of data layout for RAID5, RAID6,
593 and RAID10 arrays, and controls the failure modes for
595 It can also be used for working around a kernel bug with RAID0, but generally
596 doesn't need to be used explicitly.
598 The layout of the RAID5 parity block can be one of
599 .BR left\-asymmetric ,
600 .BR left\-symmetric ,
601 .BR right\-asymmetric ,
602 .BR right\-symmetric ,
603 .BR la ", " ra ", " ls ", " rs .
605 .BR left\-symmetric .
607 It is also possible to cause RAID5 to use a RAID4-like layout by
613 Finally for RAID5 there are DDF\-compatible layouts,
614 .BR ddf\-zero\-restart ,
615 .BR ddf\-N\-restart ,
617 .BR ddf\-N\-continue .
619 These same layouts are available for RAID6. There are also 4 layouts
620 that will provide an intermediate stage for converting between RAID5
621 and RAID6. These provide a layout which is identical to the
622 corresponding RAID5 layout on the first N\-1 devices, and has the 'Q'
623 syndrome (the second 'parity' block used by RAID6) on the last device.
625 .BR left\-symmetric\-6 ,
626 .BR right\-symmetric\-6 ,
627 .BR left\-asymmetric\-6 ,
628 .BR right\-asymmetric\-6 ,
630 .BR parity\-first\-6 .
632 When setting the failure mode for level
635 .BR write\-transient ", " wt ,
636 .BR read\-transient ", " rt ,
637 .BR write\-persistent ", " wp ,
638 .BR read\-persistent ", " rp ,
640 .BR read\-fixable ", " rf ,
641 .BR clear ", " flush ", " none .
643 Each failure mode can be followed by a number, which is used as a period
644 between fault generation. Without a number, the fault is generated
645 once on the first relevant request. With a number, the fault will be
646 generated after that many requests, and will continue to be generated
647 every time the period elapses.
649 Multiple failure modes can be current simultaneously by using the
651 option to set subsequent failure modes.
653 "clear" or "none" will remove any pending or periodic failure modes,
654 and "flush" will clear any persistent faults.
656 The layout options for RAID10 are one of 'n', 'o' or 'f' followed
657 by a small number signifying the number of copies of each datablock.
658 The default is 'n2'. The supported options are:
661 signals 'near' copies. Multiple copies of one data block are at
662 similar offsets in different devices.
665 signals 'offset' copies. Rather than the chunks being duplicated
666 within a stripe, whole stripes are duplicated but are rotated by one
667 device so duplicate blocks are on different devices. Thus subsequent
668 copies of a block are in the next drive, and are one chunk further
673 (multiple copies have very different offsets).
674 See md(4) for more detail about 'near', 'offset', and 'far'.
676 As for the number of copies of each data block, 2 is normal, 3
677 can be useful. This number can be at most equal to the number of
678 devices in the array. It does not need to divide evenly into that
679 number (e.g. it is perfectly legal to have an 'n2' layout for an array
680 with an odd number of devices).
682 A bug introduced in Linux 3.14 means that RAID0 arrays
683 .B "with devices of differing sizes"
684 started using a different layout. This could lead to
685 data corruption. Since Linux 5.4 (and various stable releases that received
686 backports), the kernel will not accept such an array unless
687 a layout is explicitly set. It can be set to
691 When creating a new array,
695 by default, so the layout does not normally need to be set.
696 An array created for either
700 will not be recognized by an (unpatched) kernel prior to 5.4. To create
701 a RAID0 array with devices of differing sizes that can be used on an
702 older kernel, you can set the layout to
704 This will use whichever layout the running kernel supports, so the data
705 on the array may become corrupt when changing kernel from pre-3.14 to a
708 When an array is converted between RAID5 and RAID6 an intermediate
709 RAID6 layout is used in which the second parity block (Q) is always on
710 the last device. To convert a RAID5 to RAID6 and leave it in this new
711 layout (which does not require re-striping) use
712 .BR \-\-layout=preserve .
713 This will try to avoid any restriping.
715 The converse of this is
716 .B \-\-layout=normalise
717 which will change a non-standard RAID6 layout into a more standard
724 (thus explaining the p of
728 .BR \-b ", " \-\-bitmap=
729 Specify how to store a write-intent bitmap. Following values are supported:
732 - the bitmap is stored with the metadata on the array and so is replicated on all devices.
735 - the array is created for a clustered environment. One bitmap is created for each node as defined
738 parameter and are stored internally.
741 - create array with no bitmap or remove any present bitmap (grow mode).
744 .BR \-\-bitmap\-chunk=
745 Set the chunk size of the bitmap. Each bit corresponds to that many
746 Kilobytes of storage.
749 bitmap, the chunk size defaults to 64Meg, or larger if necessary to
750 fit the bitmap into the available space.
752 A suffix of 'K', 'M', 'G' or 'T' can be given to indicate Kilobytes,
753 Megabytes, Gigabytes or Terabytes respectively.
756 .BR \-W ", " \-\-write\-mostly
757 subsequent devices listed in a
762 command will be flagged as 'write\-mostly'. This is valid for RAID1
763 only and means that the 'md' driver will avoid reading from these
764 devices if at all possible. This can be useful if mirroring over a
768 .BR \-\-write\-behind=
769 Specify that write-behind mode should be enabled (valid for RAID1
770 only). If an argument is specified, it will set the maximum number
771 of outstanding writes allowed. The default value is 256.
772 A write-intent bitmap is required in order to use write-behind
773 mode, and write-behind is only attempted on drives marked as
778 subsequent devices listed in a
782 command will be flagged as 'failfast'. This is valid for RAID1 and
783 RAID10 only. IO requests to these devices will be encouraged to fail
784 quickly rather than cause long delays due to error handling. Also no
785 attempt is made to repair a read error on these devices.
787 If an array becomes degraded so that the 'failfast' device is the only
788 usable device, the 'failfast' flag will then be ignored and extended
789 delays will be preferred to complete failure.
791 The 'failfast' flag is appropriate for storage arrays which have a
792 low probability of true failure, but which may sometimes
793 cause unacceptable delays due to internal maintenance functions.
796 .BR \-\-assume\-clean
799 that the array pre-existed and is known to be clean. It can be useful
800 when trying to recover from a major failure as you can be sure that no
801 data will be affected unless you actually write to the array. It can
802 also be used when creating a RAID1 or RAID10 if you want to avoid the
803 initial resync, however this practice \(em while normally safe \(em is not
804 recommended. Use this only if you really know what you are doing.
806 When the devices that will be part of a new array were filled
807 with zeros before creation the operator knows the array is
808 actually clean. If that is the case, such as after running
809 badblocks, this argument can be used to tell mdadm the
810 facts the operator knows.
812 When an array is resized to a larger size with
813 .B "\-\-grow \-\-size="
814 the new space is normally resynced in that same way that the whole
815 array is resynced at creation.
817 can be used with that command to avoid the automatic resync.
821 When creating an array, send write zeroes requests to all the block
822 devices. This should zero the data area on all disks such that the
823 initial sync is not necessary and, if successful, will behave as if
827 This is intended for use with devices that have hardware offload for
828 zeroing, but despite this zeroing can still take several minutes for
829 large disks. Thus a message is printed before and after zeroing and
830 each disk is zeroed in parallel with the others.
832 This is only meaningful with --create.
835 .BR \-\-backup\-file=
838 is used to increase the number of raid devices in a RAID5 or RAID6 if
839 there are no spare devices available, or to shrink, change RAID level
840 or layout. See the GROW MODE section below on RAID\-DEVICES CHANGES.
841 The file must be stored on a separate device, not on the RAID array
846 Arrays with 1.x metadata can leave a gap between the start of the
847 device and the start of array data. This gap can be used for various
848 metadata. The start of data is known as the
850 Normally an appropriate data offset is computed automatically.
851 However it can be useful to set it explicitly such as when re-creating
852 an array which was originally created using a different version of
854 which computed a different offset.
856 Setting the offset explicitly over-rides the default. The value given
857 is in Kilobytes unless a suffix of 'K', 'M', 'G' or 'T' is used to explicitly
858 indicate Kilobytes, Megabytes, Gigabytes or Terabytes respectively.
861 can also be used with
863 for some RAID levels (initially on RAID10). This allows the
864 data\-offset to be changed as part of the reshape process. When the
865 data offset is changed, no backup file is required as the difference
866 in offsets is used to provide the same functionality.
868 When the new offset is earlier than the old offset, the number of
869 devices in the array cannot shrink. When it is after the old offset,
870 the number of devices in the array cannot increase.
872 When creating an array,
876 In the case each member device is expected to have an offset appended
877 to the name, separated by a colon. This makes it possible to recreate
878 exactly an array which has varying data offsets (as can happen when
879 different versions of
881 are used to add different devices).
884 .BR \-N ", " \-\-name=
887 for the array. It cannot be longer than 32 chars. This is effective when
888 creating an array with a v1 metadata, or an external array.
890 If name is needed but not specified, it is taken from the basename of the device
891 that is being created. See
898 run the array, even if some of the components
899 appear to be active in another array or filesystem. Normally
901 will ask for confirmation before including such components in an
902 array. This option causes that question to be suppressed.
905 .BR \-f ", " \-\-force
908 accept the geometry and layout specified without question. Normally
910 will not allow the creation of an array with only one device, and will try
911 to create a RAID5 array with one missing drive (as this makes the
912 initial resync work faster). With
915 will not try to be so clever.
918 .BR \-o ", " \-\-readonly
921 rather than read-write as normal. No writes will be allowed to the
922 array, and no resync, recovery, or reshape will be started. It works with
923 Create, Assemble, Manage and Misc mode.
926 .BR \-a ", " "\-\-add"
927 This option can be used in Grow mode in two cases.
929 If the target array is a Linear array, then
931 can be used to add one or more devices to the array. They
932 are simply catenated on to the end of the array. Once added, the
933 devices cannot be removed.
937 option is being used to increase the number of devices in an array,
940 can be used to add some extra devices to be included in the array.
941 In most cases this is not needed as the extra devices can be added as
942 spares first, and then the number of raid disks can be changed.
943 However, for RAID0 it is not possible to add spares. So to increase
944 the number of devices in a RAID0, it is necessary to set the new
945 number of devices, and to add the new devices, in the same command.
949 Only works when the array is created for a clustered environment. It specifies
950 the maximum number of nodes in the cluster that will use this device
951 simultaneously. If not specified, this defaults to 4.
954 .BR \-\-write-journal
955 Specify journal device for the RAID-4/5/6 array. The journal device
956 should be an SSD with a reasonable lifetime.
959 .BR \-k ", " \-\-consistency\-policy=
960 Specify how the array maintains consistency in the case of an unexpected shutdown.
961 Only relevant for RAID levels with redundancy.
962 Currently supported options are:
967 Full resync is performed and all redundancy is regenerated when the array is
968 started after an unclean shutdown.
972 Resync assisted by a write-intent bitmap. Implicitly selected when using
977 For RAID levels 4/5/6, the journal device is used to log transactions and replay
978 after an unclean shutdown. Implicitly selected when using
979 .BR \-\-write\-journal .
983 For RAID5 only, Partial Parity Log is used to close the write hole and
984 eliminate resync. PPL is stored in the metadata region of RAID member drives,
985 no additional journal drive is needed.
988 Can be used with \-\-grow to change the consistency policy of an active array
989 in some cases. See CONSISTENCY POLICY CHANGES below.
996 .BR \-u ", " \-\-uuid=
997 uuid of array to assemble. Devices which don't have this uuid are
1001 .BR \-m ", " \-\-super\-minor=
1002 Minor number of device that array was created for. Devices which
1003 don't have this minor number are excluded. If you create an array as
1004 /dev/md1, then all superblocks will contain the minor number 1, even if
1005 the array is later assembled as /dev/md2.
1007 Giving the literal word "dev" for
1011 to use the minor number of the md device that is being assembled.
1012 e.g. when assembling
1014 .B \-\-super\-minor=dev
1015 will look for super blocks with a minor number of 0.
1018 is only relevant for v0.90 metadata, and should not normally be used.
1024 .BR \-N ", " \-\-name=
1025 Specify the name of the array to assemble. It cannot be longer than 32 chars.
1026 This must be the name that was specified when creating the array. It must
1027 either match the name stored in the superblock exactly, or it must match
1030 prefixed to the start of the given name.
1033 .BR \-f ", " \-\-force
1034 Assemble the array even if the metadata on some devices appears to be
1037 cannot find enough working devices to start the array, but can find
1038 some devices that are recorded as having failed, then it will mark
1039 those devices as working so that the array can be started. This works only for
1040 native. For external metadata it allows to start dirty degraded RAID 4, 5, 6.
1041 An array which requires
1043 to be started may contain data corruption. Use it carefully.
1046 .BR \-R ", " \-\-run
1047 Attempt to start the array even if fewer drives were given than were
1048 present last time the array was active. Normally if not all the
1049 expected drives are found and
1051 is not used, then the array will be assembled but not started.
1054 an attempt will be made to start it anyway.
1058 This is the reverse of
1060 in that it inhibits the startup of array unless all expected drives
1061 are present. This is only needed with
1063 and can be used if the physical connections to devices are
1064 not as reliable as you would like.
1067 .BR \-\-backup\-file=
1070 was used while reshaping an array (e.g. changing number of devices or
1071 chunk size) and the system crashed during the critical section, then the same
1073 must be presented to
1075 to allow possibly corrupted data to be restored, and the reshape
1079 .BR \-\-invalid\-backup
1080 If the file needed for the above option is not available for any
1081 reason an empty file can be given together with this option to
1082 indicate that the backup file is invalid. In this case the data that
1083 was being rearranged at the time of the crash could be irrecoverably
1084 lost, but the rest of the array may still be recoverable. This option
1085 should only be used as a last resort if there is no way to recover the
1090 .BR \-U ", " \-\-update=
1091 Update the superblock on each device while assembling the array. The
1092 argument given to this flag can be one of
1107 .BR layout\-original ,
1108 .BR layout\-alternate ,
1109 .BR layout\-unspecified ,
1116 option will update the
1117 .B "preferred minor"
1118 field on each superblock to match the minor number of the array being
1120 This can be useful if
1122 reports a different "Preferred Minor" to
1124 In some cases this update will be performed automatically
1125 by the kernel driver. In particular, the update happens automatically
1126 at the first write to an array with redundancy (RAID level 1 or
1131 option will change the uuid of the array. If a UUID is given with the
1133 option that UUID will be used as a new UUID and will
1135 be used to help identify the devices in the array.
1138 is given, a random UUID is chosen.
1142 option will change the
1144 of the array as stored in the superblock. This is only supported for
1145 version-1 superblocks.
1149 option will change the
1151 of the array as stored in the bitmap superblock. This option only
1152 works for a clustered environment.
1156 option will change the
1158 as recorded in the superblock. For version-0 superblocks, this is the
1159 same as updating the UUID.
1160 For version-1 superblocks, this involves updating the name.
1164 option will change the cluster name as recorded in the superblock and
1165 bitmap. This option only works for a clustered environment.
1169 option will cause the array to be marked
1171 meaning that any redundancy in the array (e.g. parity for RAID5,
1172 copies for RAID1) may be incorrect. This will cause the RAID system
1173 to perform a "resync" pass to make sure that all redundant information
1178 option allows arrays to be moved between machines with different
1179 byte-order, such as from a big-endian machine like a Sparc or some
1180 MIPS machines, to a little-endian x86_64 machine.
1181 When assembling such an array for the first time after a move, giving
1182 .B "\-\-update=byteorder"
1185 to expect superblocks to have their byteorder reversed, and will
1186 correct that order before assembling the array. This is only valid
1187 with original (Version 0.90) superblocks.
1191 option will correct the summaries in the superblock. That is the
1192 counts of total, working, active, failed, and spare devices.
1196 option will rarely be of use. It applies to version 1.1 and 1.2 metadata
1197 only (where the metadata is at the start of the device) and is only
1198 useful when the component device has changed size (typically become
1199 larger). The version 1 metadata records the amount of the device that
1200 can be used to store data, so if a device in a version 1.1 or 1.2
1201 array becomes larger, the metadata will still be visible, but the
1202 extra space will not. In this case it might be useful to assemble the
1204 .BR \-\-update=devicesize .
1207 to determine the maximum usable amount of space on each device and
1208 update the relevant field in the metadata.
1212 option only works on v0.90 metadata arrays and will convert them to
1213 v1.0 metadata. The array must not be dirty (i.e. it must not need a
1214 sync) and it must not have a write-intent bitmap.
1216 The old metadata will remain on the devices, but will appear older
1217 than the new metadata and so will usually be ignored. The old metadata
1218 (or indeed the new metadata) can be removed by giving the appropriate
1221 .BR \-\-zero\-superblock .
1225 option can be used when an array has an internal bitmap which is
1226 corrupt in some way so that assembling the array normally fails. It
1227 will cause any internal bitmap to be ignored.
1231 option will reserve space in each device for a bad block list. This
1232 will be 4K in size and positioned near the end of any free space
1233 between the superblock and the data.
1237 option will cause any reservation of space for a bad block list to be
1238 removed. If the bad block list contains entries, this will fail, as
1239 removing the list could cause data corruption.
1243 option will enable PPL for a RAID5 array and reserve space for PPL on each
1244 device. There must be enough free space between the data and superblock and a
1245 write-intent bitmap or journal must not be used.
1249 option will disable PPL in the superblock.
1254 .B layout\-alternate
1255 options are for RAID0 arrays with non-uniform devices size that were in
1256 use before Linux 5.4. If the array was being used with Linux 3.13 or
1257 earlier, then to assemble the array on a new kernel,
1258 .B \-\-update=layout\-original
1259 must be given. If the array was created and used with a kernel from Linux 3.14 to
1261 .B \-\-update=layout\-alternate
1262 must be given. This only needs to be given once. Subsequent assembly of the array
1263 will happen normally.
1264 For more information, see
1268 .B layout\-unspecified
1269 option reverts the effect of
1272 .B layout\-alternate
1273 and allows the array to be again used on a kernel prior to Linux 5.3.
1274 This option should be used with great caution.
1276 .SH For Manage mode:
1279 .BR \-t ", " \-\-test
1280 Unless a more serious error occurred,
1282 will exit with a status of 2 if no changes were made to the array and
1283 0 if at least one change was made.
1284 This can be useful when an indirect specifier such as
1289 is used in requesting an operation on the array.
1291 will report failure if these specifiers didn't find any match.
1294 .BR \-a ", " \-\-add
1295 hot-add listed devices.
1296 If a device appears to have recently been part of the array
1297 (possibly it failed or was removed) the device is re\-added as described
1299 If that fails or the device was never part of the array, the device is
1300 added as a hot-spare.
1301 If the array is degraded, it will immediately start to rebuild data
1304 Note that this and the following options are only meaningful on array
1305 with redundancy. They don't apply to RAID0 or Linear.
1309 re\-add a device that was previously removed from an array.
1310 If the metadata on the device reports that it is a member of the
1311 array, and the slot that it used is still vacant, then the device will
1312 be added back to the array in the same position. This will normally
1313 cause the data for that device to be recovered. However, based on the
1314 event count on the device, the recovery may only require sections that
1315 are flagged by a write-intent bitmap to be recovered or may not require
1316 any recovery at all.
1318 When used on an array that has no metadata (i.e. it was built with
1320 it will be assumed that bitmap-based recovery is enough to make the
1321 device fully consistent with the array.
1324 can also be accompanied by
1325 .BR \-\-update=devicesize ,
1326 .BR \-\-update=bbl ", or"
1327 .BR \-\-update=no\-bbl .
1328 See descriptions of these options when used in Assemble mode for an
1329 explanation of their use.
1331 If the device name given is
1335 will try to find any device that looks like it should be
1336 part of the array but isn't and will try to re\-add all such devices.
1338 If the device name given is
1342 will find all devices in the array that are marked
1344 remove them and attempt to immediately re\-add them. This can be
1345 useful if you are certain that the reason for failure has been
1350 Add a device as a spare. This is similar to
1352 except that it does not attempt
1354 first. The device will be added as a spare even if it looks like it
1355 could be a recent member of the array.
1358 .BR \-r ", " \-\-remove
1359 remove listed devices. They must not be active. i.e. they should
1360 be failed or spare devices.
1362 As well as the name of a device file
1372 The first causes all failed devices to be removed. The second causes
1373 any device which is no longer connected to the system (i.e an 'open'
1377 The third will remove a set as described below under
1381 .BR \-f ", " \-\-fail
1382 Mark listed devices as faulty.
1383 As well as the name of a device file, the word
1387 can be given. The former will cause any device that has been detached from
1388 the system to be marked as failed. It can then be removed.
1390 For RAID10 arrays where the number of copies evenly divides the number
1391 of devices, the devices can be conceptually divided into sets where
1392 each set contains a single complete copy of the data on the array.
1393 Sometimes a RAID10 array will be configured so that these sets are on
1394 separate controllers. In this case, all the devices in one set can be
1395 failed by giving a name like
1401 The appropriate set names are reported by
1411 Mark listed devices as requiring replacement. As soon as a spare is
1412 available, it will be rebuilt and will replace the marked device.
1413 This is similar to marking a device as faulty, but the device remains
1414 in service during the recovery process to increase resilience against
1415 multiple failures. When the replacement process finishes, the
1416 replaced device will be marked as faulty.
1420 This can follow a list of
1422 devices. The devices listed after
1424 will preferentially be used to replace the devices listed after
1426 These devices must already be spare devices in the array.
1429 .BR \-\-write\-mostly
1430 Subsequent devices that are added or re\-added will have the 'write-mostly'
1431 flag set. This is only valid for RAID1 and means that the 'md' driver
1432 will avoid reading from these devices if possible.
1435 Subsequent devices that are added or re\-added will have the 'write-mostly'
1438 .BR \-\-cluster\-confirm
1439 Confirm the existence of the device. This is issued in response to an \-\-add
1440 request by a node in a cluster. When a node adds a device it sends a message
1441 to all nodes in the cluster to look for a device with a UUID. This translates
1442 to a udev notification with the UUID of the device to be added and the slot
1443 number. The receiving node must acknowledge this message
1444 with \-\-cluster\-confirm. Valid arguments are <slot>:<devicename> in case
1445 the device is found or <slot>:missing in case the device is not found.
1449 Add a journal to an existing array, or recreate journal for a RAID-4/5/6 array
1450 that lost a journal device. To avoid interrupting ongoing write operations,
1452 only works for array in Read-Only state.
1456 Subsequent devices that are added or re\-added will have
1457 the 'failfast' flag set. This is only valid for RAID1 and RAID10 and
1458 means that the 'md' driver will avoid long timeouts on error handling
1462 Subsequent devices that are re\-added will be re\-added without
1463 the 'failfast' flag set.
1466 Each of these options requires that the first device listed is the array
1467 to be acted upon, and the remainder are component devices to be added,
1468 removed, marked as faulty, etc. Several different operations can be
1469 specified for different devices, e.g.
1471 mdadm /dev/md0 \-\-add /dev/sda1 \-\-fail /dev/sdb1 \-\-remove /dev/sdb1
1473 Each operation applies to all devices listed until the next
1476 If an array is using a write-intent bitmap, then devices which have
1477 been removed can be re\-added in a way that avoids a full
1478 reconstruction but instead just updates the blocks that have changed
1479 since the device was removed. For arrays with persistent metadata
1480 (superblocks) this is done automatically. For arrays created with
1482 mdadm needs to be told that this device we removed recently with
1485 Devices can only be removed from an array if they are not in active
1486 use, i.e. that must be spares or failed devices. To remove an active
1487 device, it must first be marked as
1493 .BR \-Q ", " \-\-query
1494 Examine a device to see
1495 (1) if it is an md device and (2) if it is a component of an md
1497 Information about what is discovered is presented.
1500 .BR \-D ", " \-\-detail
1501 Print details of one or more md devices.
1504 .BR \-\-detail\-platform
1505 Print details of the platform's RAID capabilities (firmware / hardware
1506 topology) for a given metadata format. If used without an argument, mdadm
1507 will scan all controllers looking for their capabilities. Otherwise, mdadm
1508 will only look at the controller specified by the argument in the form of an
1509 absolute filepath or a link, e.g.
1510 .IR /sys/devices/pci0000:00/0000:00:1f.2 .
1513 .BR \-Y ", " \-\-export
1516 .BR \-\-detail-platform ,
1520 output will be formatted as
1522 pairs for easy import into the environment.
1528 indicates whether an array was started
1530 or not, which may include a reason
1531 .RB ( unsafe ", " nothing ", " no ).
1534 indicates if the array is expected on this host
1536 or seems to be from elsewhere
1540 .BR \-E ", " \-\-examine
1541 Print contents of the metadata stored on the named device(s).
1542 Note the contrast between
1547 applies to devices which are components of an array, while
1549 applies to a whole array which is currently active.
1552 .BR \-X ", " \-\-examine\-bitmap
1553 Report information about a bitmap.
1554 The argument is an array component. Note that running this on an array
1557 does not report the bitmap for that array.
1560 .B \-\-examine\-badblocks
1561 List the bad-blocks recorded for the device, if a bad-blocks list has
1562 been configured. Currently only
1566 metadata support bad-blocks lists.
1569 .BI \-\-dump= directory
1571 .BI \-\-restore= directory
1572 Save metadata from lists devices, or restore metadata to listed devices.
1575 .BR \-R ", " \-\-run
1576 start a partially assembled array. If
1578 did not find enough devices to fully start the array, it might leaving
1579 it partially assembled. If you wish, you can then use
1581 to start the array in degraded mode.
1584 .BR \-S ", " \-\-stop
1585 deactivate array, releasing all resources.
1588 .BR \-o ", " \-\-readonly
1589 mark array as readonly.
1592 .BR \-w ", " \-\-readwrite
1593 mark array as readwrite.
1596 .B \-\-zero\-superblock
1597 If the device contains a valid md superblock, the block is
1598 overwritten with zeros. With
1600 the block where the superblock would be is overwritten even if it
1601 doesn't appear to be valid.
1604 Be careful when calling \-\-zero\-superblock with clustered raid. Make sure
1605 the array isn't used or assembled in another cluster node before executing it.
1608 .B \-\-kill\-subarray=
1609 If the device is a container and the argument to \-\-kill\-subarray
1610 specifies an inactive subarray in the container, then the subarray is
1611 deleted. Deleting all subarrays will leave an 'empty-container' or
1612 spare superblock on the drives. See
1613 .B \-\-zero\-superblock
1615 removing a superblock. Note that some formats depend on the subarray
1616 index for generating a UUID, this command will fail if it would change
1617 the UUID of an active subarray.
1620 .B \-\-update\-subarray=
1621 If the device is a container and the argument to \-\-update\-subarray
1622 specifies a subarray in the container, then attempt to update the given
1623 superblock field in the subarray. See below in
1628 .BR \-t ", " \-\-test
1633 is set to reflect the status of the device. See below in
1638 .BR \-W ", " \-\-wait
1639 For each md device given, wait for any resync, recovery, or reshape
1640 activity to finish before returning.
1642 will return with success if it actually waited for every device
1643 listed, otherwise it will return failure.
1647 For each md device given, or each device in /proc/mdstat if
1649 is given, arrange for the array to be marked clean as soon as possible.
1651 will return with success if the array uses external metadata and we
1652 successfully waited. For native arrays, this returns immediately as the
1653 kernel handles dirty-clean transitions at shutdown. No action is taken
1654 if safe-mode handling is disabled.
1658 Set the "sync_action" for all md devices given to one of
1665 will abort any currently running action though some actions will
1666 automatically restart.
1669 will abort any current action and ensure no other action starts
1679 .BR "SCRUBBING AND MISMATCHES" .
1683 it generates the udev rules to the file that handles hot-plug bare devices.
1684 Given the POLICYs defined under
1685 .IR {CONFFILE}\ (or {CONFFILE2})
1689 for more details and usage examples about POLICY.
1691 .SH For Incremental Assembly mode:
1693 .BR \-\-rebuild\-map ", " \-r
1694 Rebuild the map file
1698 uses to help track which arrays are currently being assembled.
1701 .BR \-\-run ", " \-R
1702 Run any array assembled as soon as a minimal number of devices is
1703 available, rather than waiting until all expected devices are present.
1706 .BR \-\-scan ", " \-s
1707 Only meaningful with
1711 file for arrays that are being incrementally assembled and will try to
1712 start any that are not already started.
1715 .BR \-\-fail ", " \-f
1716 This allows the hot-plug system to remove devices that have fully disappeared
1717 from the kernel. It will first fail and then remove the device from any
1718 array it belongs to.
1719 The device name given should be a kernel device name such as "sda",
1725 Only used with \-\-fail. The 'path' given will be recorded so that if
1726 a new device appears at the same location it can be automatically
1727 added to the same array. This allows the failed device to be
1728 automatically replaced by a new device without metadata if it appears
1729 at specified path. This option is normally only set by an
1733 .SH For Monitor mode:
1735 .BR \-m ", " \-\-mail
1736 Give an mail address to send alerts to. Can be configured in
1741 .BR \-p ", " \-\-program ", " \-\-alert
1742 Give a program to be run whenever an event is detected. Can be configured in
1747 .BR \-y ", " \-\-syslog
1748 Cause all events to be reported through 'syslog'. The messages have
1749 facility of 'daemon' and varying priorities.
1752 .BR \-d ", " \-\-delay
1753 Give a delay in seconds. The default is 60 seconds.
1755 polls the md arrays and then waits this many seconds before polling again if no event happened.
1756 Can be configured in
1761 .BR \-r ", " \-\-increment
1762 Give a percentage increment.
1764 will generate RebuildNN events with the given percentage increment.
1767 .BR \-f ", " \-\-daemonise
1770 to run as a background daemon if it decides to monitor anything. This
1771 causes it to fork and run in the child, and to disconnect from the
1772 terminal. The process id of the child is written to stdout.
1775 which will only continue monitoring if a mail address or alert program
1776 is found in the config file.
1779 .BR \-i ", " \-\-pid\-file
1782 is running in daemon mode, write the pid of the daemon process to
1783 the specified file, instead of printing it on standard output.
1786 .BR \-1 ", " \-\-oneshot
1787 Check arrays only once. This will generate
1789 events and more significantly
1795 .B " mdadm \-\-monitor \-\-scan \-1"
1797 from a cron script will ensure regular notification of any degraded arrays.
1800 .BR \-t ", " \-\-test
1803 alert for every array found at startup. This alert gets mailed and
1804 passed to the alert program. This can be used for testing that alert
1805 message do get through successfully.
1809 This inhibits the functionality for moving spares between arrays.
1810 Only one monitoring process started with
1812 but without this flag is allowed, otherwise the two could interfere
1819 .B mdadm \-\-assemble
1820 .I md-device options-and-component-devices...
1823 .B mdadm \-\-assemble \-\-scan
1824 .I md-devices-and-options...
1827 .B mdadm \-\-assemble \-\-scan
1831 This usage assembles one or more RAID arrays from pre-existing components.
1832 For each array, mdadm needs to know the md device, the identity of the
1833 array, and the number of component devices. These can be found in a number of ways.
1835 In the first usage example (without the
1837 the first device given is the md device.
1838 In the second usage example, all devices listed are treated as md
1839 devices and assembly is attempted.
1840 In the third (where no devices are listed) all md devices that are
1841 listed in the configuration file are assembled. If no arrays are
1842 described by the configuration file, then any arrays that
1843 can be found on unused devices will be assembled.
1845 If precisely one device is listed, but
1851 was given and identity information is extracted from the configuration file.
1853 The identity can be given with the
1859 option, will be taken from the md-device record in the config file, or
1860 will be taken from the super block of the first component-device
1861 listed on the command line.
1863 Devices can be given on the
1865 command line or in the config file. Only devices which have an md
1866 superblock which contains the right identity will be considered for
1869 The config file is only used if explicitly named with
1871 or requested with (a possibly implicit)
1873 In the latter case, the default config file is used. See
1879 is not given, then the config file will only be used to find the
1880 identity of md arrays.
1882 Normally the array will be started after it is assembled. However if
1884 is not given and not all expected drives were listed, then the array
1885 is not started (to guard against usage errors). To insist that the
1886 array be started in this case (as may work for RAID1, 4, 5, 6, or 10),
1895 does not create any entries in
1899 It does record information in
1903 to choose the correct name.
1907 detects that udev is not configured, it will create the devices in
1916 and no devices are listed,
1918 will first attempt to assemble all the arrays listed in the config
1921 If no arrays are listed in the config (other than those marked
1923 it will look through the available devices for possible arrays and
1924 will try to assemble anything that it finds. Arrays which are tagged
1925 as belonging to the given homehost will be assembled and started
1926 normally. Arrays which do not obviously belong to this host are given
1927 names that are expected not to conflict with anything local, and are
1928 started "read-auto" so that nothing is written to any device until the
1929 array is written to. i.e. automatic resync etc is delayed.
1933 finds a consistent set of devices that look like they should comprise
1934 an array, and if the superblock is tagged as belonging to the given
1935 home host, it will automatically choose a device name and try to
1936 assemble the array. If the array uses version-0.90 metadata, then the
1938 number as recorded in the superblock is used to create a name in
1942 If the array uses version-1 metadata, then the
1944 from the superblock is used to similarly create a name in
1946 (the name will have any 'host' prefix stripped first).
1948 This behaviour can be modified by the
1952 configuration file. This line can indicate that specific metadata
1953 type should, or should not, be automatically assembled. If an array
1954 is found which is not listed in
1956 and has a metadata format that is denied by the
1958 line, then it will not be assembled.
1961 line can also request that all arrays identified as being for this
1962 homehost should be assembled regardless of their metadata type.
1965 for further details.
1967 Note: Auto-assembly cannot be used for assembling and activating some
1968 arrays which are undergoing reshape. In particular as the
1970 cannot be given, any reshape which requires a backup file to continue
1971 cannot be started by auto-assembly. An array which is growing to more
1972 devices and has passed the critical section can be assembled using
1983 .BI \-\-raid\-devices= Z
1987 This usage is similar to
1989 The difference is that it creates an array without a superblock. With
1990 these arrays there is no difference between initially creating the array and
1991 subsequently assembling the array, except that hopefully there is useful
1992 data there in the second case.
1994 The level may raid0, linear, raid1, raid10, multipath, or faulty, or
1995 one of their synonyms. All devices must be listed and the array will
1996 be started once complete. It will often be appropriate to use
1997 .B \-\-assume\-clean
1998 with levels raid1 or raid10.
2008 .BI \-\-raid\-devices= Z
2012 This usage will initialize a new md array, associate some devices with
2013 it, and activate the array.
2016 is a new device. This could be standard name or chosen name. For details see:
2019 The named device will normally not exist when
2020 .I "mdadm \-\-create"
2021 is run, but will be created by
2023 once the array becomes active.
2025 The max length md-device name is limited to 32 characters.
2026 Different metadata types have more strict limitation
2027 (like IMSM where only 16 characters are allowed).
2028 For that reason, long name could be truncated or rejected, it depends on metadata policy.
2030 As devices are added, they are checked to see if they contain RAID
2031 superblocks or filesystems. They are also checked to see if the variance in
2032 device size exceeds 1%.
2034 If any discrepancy is found, the array will not automatically be run, though
2037 can override this caution.
2039 To create a "degraded" array in which some devices are missing, simply
2040 give the word "\fBmissing\fP"
2041 in place of a device name. This will cause
2043 to leave the corresponding slot in the array empty.
2044 For a RAID4 or RAID5 array at most one slot can be
2045 "\fBmissing\fP"; for a RAID6 array at most two slots.
2046 For a RAID1 array, only one real device needs to be given. All of the
2050 When creating a RAID5 array,
2052 will automatically create a degraded array with an extra spare drive.
2053 This is because building the spare into a degraded array is in general
2054 faster than resyncing the parity on a non-degraded, but not clean,
2055 array. This feature can be overridden with the
2059 When creating a partition based array, using
2061 with version-1.x metadata, the partition type should be set to
2063 (non fs-data). This type of selection allows for greater precision since
2064 using any other [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)],
2065 might create problems in the event of array recovery through a live cdrom.
2067 A new array will normally get a randomly assigned 128bit UUID which is
2068 very likely to be unique. If you have a specific need, you can choose
2069 a UUID for the array by giving the
2071 option. Be warned that creating two arrays with the same UUID is a
2072 recipe for disaster. Also, using
2074 when creating a v0.90 array will silently override any
2079 .\"option is given, it is not necessary to list any component devices in this command.
2080 .\"They can be added later, before a
2084 .\"is given, the apparent size of the smallest drive given is used.
2086 Space for a bitmap will be reserved so that one can be added later with
2087 .BR "\-\-grow \-\-bitmap=internal" .
2089 If the metadata type supports it (currently only 1.x and IMSM metadata),
2090 space will be allocated to store a bad block list. This allows a modest
2091 number of bad blocks to be recorded, allowing the drive to remain in
2092 service while only partially functional.
2094 When creating an array within a
2097 can be given either the list of devices to use, or simply the name of
2098 the container. The former case gives control over which devices in
2099 the container will be used for the array. The latter case allows
2101 to automatically choose which devices to use based on how much spare
2104 The General Management options that are valid with
2109 insist on running the array even if some devices look like they might
2114 start the array in readonly mode.
2121 .I options... devices...
2124 This usage will allow individual devices in an array to be failed,
2125 removed or added. It is possible to perform multiple operations with
2126 on command. For example:
2128 .B " mdadm /dev/md0 \-f /dev/hda1 \-r /dev/hda1 \-a /dev/hda1"
2134 and will then remove it from the array and finally add it back
2135 in as a spare. However, only one md array can be affected by a single
2138 When a device is added to an active array, mdadm checks to see if it
2139 has metadata on it which suggests that it was recently a member of the
2140 array. If it does, it tries to "re\-add" the device. If there have
2141 been no changes since the device was removed, or if the array has a
2142 write-intent bitmap which has recorded whatever changes there were,
2143 then the device will immediately become a full member of the array and
2144 those differences recorded in the bitmap will be resolved.
2154 MISC mode includes a number of distinct operations that
2155 operate on distinct devices. The operations are:
2158 The device is examined to see if it is
2159 (1) an active md array, or
2160 (2) a component of an md array.
2161 The information discovered is reported.
2165 The device should be an active md device.
2167 will display a detailed description of the array.
2171 will cause the output to be less detailed and the format to be
2172 suitable for inclusion in
2176 will normally be 0 unless
2178 failed to get useful information about the device(s); however, if the
2180 option is given, then the exit status will be:
2184 The array is functioning normally.
2187 The array has at least one failed device.
2190 The array has multiple failed devices such that it is unusable.
2193 There was an error while trying to get information about the device.
2197 .B \-\-detail\-platform
2198 Print detail of the platform's RAID capabilities (firmware / hardware
2199 topology). If the metadata is specified with
2203 then the return status will be:
2207 metadata successfully enumerated its platform components on this system
2210 metadata is platform independent
2213 metadata failed to find its platform components on this system
2217 .B \-\-update\-subarray=
2218 If the device is a container and the argument to \-\-update\-subarray
2219 specifies a subarray in the container, then attempt to update the given
2220 superblock field in the subarray. Similar to updating an array in
2221 "assemble" mode, the field to update is selected by
2225 option. The supported options are
2235 option updates the subarray name in the metadata. It cannot be longer than
2236 32 chars. If successes, new value will be respected after next assembly.
2242 options enable and disable PPL in the metadata. Currently supported only for
2249 options enable and disable write-intent bitmap in the metadata. Currently supported only for
2254 The device should be a component of an md array.
2256 will read the md superblock of the device and display the contents.
2261 is given, then multiple devices that are components of the one array
2262 are grouped together and reported in a single entry suitable
2268 without listing any devices will cause all devices listed in the
2269 config file to be examined.
2272 .BI \-\-dump= directory
2273 If the device contains RAID metadata, a file will be created in the
2275 and the metadata will be written to it. The file will be the same
2276 size as the device and will have the metadata written at the
2277 same location as it exists in the device. However, the file will be "sparse" so
2278 that only those blocks containing metadata will be allocated. The
2279 total space used will be small.
2281 The filename used in the
2283 will be the base name of the device. Further, if any links appear in
2285 which point to the device, then hard links to the file will be created
2292 Multiple devices can be listed and their metadata will all be stored
2293 in the one directory.
2296 .BI \-\-restore= directory
2297 This is the reverse of
2300 will locate a file in the directory that has a name appropriate for
2301 the given device and will restore metadata from it. Names that match
2303 names are preferred, however if two of those refer to different files,
2305 will not choose between them but will abort the operation.
2307 If a file name is given instead of a
2311 will restore from that file to a single device, always provided the
2312 size of the file matches that of the device, and the file contains
2316 The devices should be active md arrays which will be deactivated, as
2317 long as they are not currently in use.
2321 This will fully activate a partially assembled md array.
2325 This will mark an active array as read-only, providing that it is
2326 not currently being used.
2332 array back to being read/write.
2336 For all operations except
2339 will cause the operation to be applied to all arrays listed in
2344 causes all devices listed in the config file to be examined.
2347 .BR \-b ", " \-\-brief
2348 Be less verbose. This is used with
2356 gives an intermediate level of verbosity.
2362 .B mdadm \-\-monitor
2363 .I options... devices...
2366 Monitor option can work in two modes:
2368 system wide mode, follow all md devices based on
2371 follow only specified MD devices in command line.
2375 indicates system wide mode. Option causes the
2377 to track all md devices that appear in
2379 If it is not set, then at least one
2383 Monitor usage causes
2385 to periodically poll a number of md arrays and to report on any events
2390 will work as long as there is an active array with redundancy and it is defined to follow (for
2392 every array is followed).
2394 As well as reporting events,
2396 may move a spare drive from one array to another if they are in the
2401 and if the destination array has a failed drive but no spares.
2403 The result of monitoring the arrays is the generation of events.
2404 These events are passed to a separate program (if specified) and may
2405 be mailed to a given E-mail address.
2407 When passing events to a program, the program is run once for each event,
2408 and is given 2 or 3 command-line arguments: the first is the
2409 name of the event (see below), the second is the name of the
2410 md device which is affected, and the third is the name of a related
2411 device if relevant (such as a component device that has failed).
2419 address must be specified on the command line or in the config file. If neither are available, then
2421 will not monitor anything. For devices given directly in command line, without
2425 specified, each event is reported to
2428 Note: On systems where mdadm monitoring is managed through systemd, the mdmonitor.service
2429 should be present. This service is designed to be the primary solution for array monitoring.
2430 It is configured to operate in system-wide mode. It is initiated by udev when start criteria are
2433 exists and necessary configuration parameters are set.
2434 It is kept alive as long as a redundant RAID array is active; it stops otherwise. User should
2435 customize MAILADDR in
2437 to receive mail notifications. MONITORDELAY, MAILFROM and PROGRAM are optional. See
2439 for detailed description of these options.
2440 Use systemctl status mdmonitor.service to verify status or determine if additional configuration
2443 The different events are:
2447 .B DeviceDisappeared
2448 An md array which previously was configured appears to no longer be
2449 configured. (syslog priority: Critical)
2453 was told to monitor an array which is RAID0 or Linear, then it will
2455 .B DeviceDisappeared
2456 with the extra information
2458 This is because RAID0 and Linear do not support the device-failed,
2459 hot-spare and resync operations which are monitored.
2463 An md array started reconstruction (e.g. recovery, resync, reshape,
2464 check, repair). (syslog priority: Warning)
2470 is a two-digit number (eg. 05, 48). This indicates that the rebuild
2471 has reached that percentage of the total. The events are generated
2472 at a fixed increment from 0. The increment size may be specified with
2473 a command-line option (the default is 20). (syslog priority: Warning)
2477 An md array that was rebuilding, isn't any more, either because it
2478 finished normally or was aborted. (syslog priority: Warning)
2482 An active component device of an array has been marked as
2483 faulty. (syslog priority: Critical)
2487 A spare component device which was being rebuilt to replace a faulty
2488 device has failed. (syslog priority: Critical)
2492 A spare component device which was being rebuilt to replace a faulty
2493 device has been successfully rebuilt and has been made active.
2494 (syslog priority: Info)
2498 A new md array has been detected in the
2500 file. (syslog priority: Info)
2504 A newly noticed array appears to be degraded. This message is not
2507 notices a drive failure which causes degradation, but only when
2509 notices that an array is degraded when it first sees the array.
2510 (syslog priority: Critical)
2514 A spare drive has been moved from one array in a
2518 to another to allow a failed drive to be replaced.
2519 (syslog priority: Info)
2525 has been told, via the config file, that an array should have a certain
2526 number of spare devices, and
2528 detects that it has fewer than this number when it first sees the
2529 array, it will report a
2532 (syslog priority: Warning)
2536 An array was found at startup, and the
2539 (syslog priority: Info)
2549 cause Email to be sent. All events cause the program to be run.
2550 The program is run with two or three arguments: the event
2551 name, the array device and possibly a second device.
2553 Each event has an associated array device (e.g.
2555 and possibly a second device. For
2560 the second device is the relevant component device.
2563 the second device is the array that the spare was moved from.
2567 to move spares from one array to another, the different arrays need to
2568 be labeled with the same
2570 or the spares must be allowed to migrate through matching POLICY domains
2571 in the configuration file. The
2573 name can be any string; it is only necessary that different spare
2574 groups use different names.
2578 detects that an array in a spare group has fewer active
2579 devices than necessary for the complete array, and has no spare
2580 devices, it will look for another array in the same spare group that
2581 has a full complement of working drives and a spare. It will then
2582 attempt to remove the spare from the second array and add it to the
2584 If the removal succeeds but the adding fails, then it is added back to
2587 If the spare group for a degraded array is not defined,
2589 will look at the rules of spare migration specified by POLICY lines in
2591 and then follow similar steps as above if a matching spare is found.
2594 The GROW mode is used for changing the size or shape of an active
2597 The following changes are supported:
2599 change the "size" attribute for RAID1, RAID4, RAID5 and RAID6.
2601 increase or decrease the "raid\-devices" attribute of RAID0, RAID1, RAID4,
2604 change the chunk-size and layout of RAID0, RAID4, RAID5, RAID6 and RAID10.
2606 convert between RAID1 and RAID5, between RAID5 and RAID6, between
2607 RAID0, RAID4, and RAID5, and between RAID0 and RAID10 (in the near-2 mode).
2609 add a write-intent bitmap to any array which supports these bitmaps, or
2610 remove a write-intent bitmap from such an array.
2612 change the array's consistency policy.
2615 Using GROW on containers is currently supported only for Intel's IMSM
2616 container format. The number of devices in a container can be
2617 increased - which affects all arrays in the container - or an array
2618 in a container can be converted between levels where those levels are
2619 supported by the container, and the conversion is on of those listed
2625 Intel's native checkpointing doesn't use
2627 option and it is transparent for assembly feature.
2629 Roaming between Windows(R) and Linux systems for IMSM metadata is not
2630 supported during grow process.
2632 When growing a raid0 device, the new component disk size (or external
2633 backup size) should be larger than LCM(old, new) * chunk-size * 2,
2634 where LCM() is the least common multiple of the old and new count of
2635 component disks, and "* 2" comes from the fact that mdadm refuses to
2636 use more than half of a spare device for backup space.
2639 Normally when an array is built the "size" is taken from the smallest
2640 of the drives. If all the small drives in an arrays are, over time,
2641 removed and replaced with larger drives, then you could have an
2642 array of large drives with only a small amount used. In this
2643 situation, changing the "size" with "GROW" mode will allow the extra
2644 space to start being used. If the size is increased in this way, a
2645 "resync" process will start to make sure the new parts of the array
2648 Note that when an array changes size, any filesystem that may be
2649 stored in the array will not automatically grow or shrink to use or
2650 vacate the space. The
2651 filesystem will need to be explicitly told to use the extra space
2652 after growing, or to reduce its size
2654 to shrinking the array.
2656 Also, the size of an array cannot be changed while it has an active
2657 bitmap. If an array has a bitmap, it must be removed before the size
2658 can be changed. Once the change is complete a new bitmap can be created.
2660 .SS RAID\-DEVICES CHANGES
2662 A RAID1 array can work with any number of devices from 1 upwards
2663 (though 1 is not very useful). There may be times which you want to
2664 increase or decrease the number of active devices. Note that this is
2665 different to hot-add or hot-remove which changes the number of
2668 When reducing the number of devices in a RAID1 array, the slots which
2669 are to be removed from the array must already be vacant. That is, the
2670 devices which were in those slots must be failed and removed.
2672 When the number of devices is increased, any hot spares that are
2673 present will be activated immediately.
2675 Changing the number of active devices in a RAID5 or RAID6 is much more
2676 effort. Every block in the array will need to be read and written
2677 back to a new location. Linux Kernel is able to increase or decrease
2678 the number of devices in a RAID5 and RAID6 safely, including restarting
2679 an interrupted "reshape".
2681 The Linux Kernel is able to convert a RAID0 into a RAID4 or RAID5.
2683 uses this functionality and the ability to add
2684 devices to a RAID4 to allow devices to be added to a RAID0. When
2685 requested to do this,
2687 will convert the RAID0 to a RAID4, add the necessary disks and make
2688 the reshape happen, and then convert the RAID4 back to RAID0.
2690 When decreasing the number of devices, the size of the array will also
2691 decrease. If there was data in the array, it could get destroyed and
2692 this is not reversible, so you should firstly shrink the filesystem on
2693 the array to fit within the new size. To help prevent accidents,
2695 requires that the size of the array be decreased first with
2696 .BR "mdadm --grow --array-size" .
2697 This is a reversible change which simply makes the end of the array
2698 inaccessible. The integrity of any data can then be checked before
2699 the non-reversible reduction in the number of devices is request.
2701 When relocating the first few stripes on a RAID5 or RAID6, it is not
2702 possible to keep the data on disk completely consistent and
2703 crash-proof. To provide the required safety, mdadm disables writes to
2704 the array while this "critical section" is reshaped, and takes a
2705 backup of the data that is in that section. For grows, this backup may be
2706 stored in any spare devices that the array has, however it can also be
2707 stored in a separate file specified with the
2709 option, and is required to be specified for shrinks, RAID level
2710 changes and layout changes. If this option is used, and the system
2711 does crash during the critical period, the same file must be passed to
2713 to restore the backup and reassemble the array. When shrinking rather
2714 than growing the array, the reshape is done from the end towards the
2715 beginning, so the "critical section" is at the end of the reshape.
2719 Changing the RAID level of any array happens instantaneously. However
2720 in the RAID5 to RAID6 case this requires a non-standard layout of the
2721 RAID6 data, and in the RAID6 to RAID5 case that non-standard layout is
2722 required before the change can be accomplished. So while the level
2723 change is instant, the accompanying layout change can take quite a
2726 is required. If the array is not simultaneously being grown or
2727 shrunk, so that the array size will remain the same - for example,
2728 reshaping a 3-drive RAID5 into a 4-drive RAID6 - the backup file will
2729 be used not just for a "critical section" but throughout the reshape
2730 operation, as described below under LAYOUT CHANGES.
2732 .SS CHUNK-SIZE AND LAYOUT CHANGES
2734 Changing the chunk-size or layout without also changing the number of
2735 devices as the same time will involve re-writing all blocks in-place.
2736 To ensure against data loss in the case of a crash, a
2738 must be provided for these changes. Small sections of the array will
2739 be copied to the backup file while they are being rearranged. This
2740 means that all the data is copied twice, once to the backup and once
2741 to the new layout on the array, so this type of reshape will go very
2744 If the reshape is interrupted for any reason, this backup file must be
2746 .B "mdadm --assemble"
2747 so the array can be reassembled. Consequently, the file cannot be
2748 stored on the device being reshaped.
2753 A write-intent bitmap can be added to, or removed from, an active
2756 .SS CONSISTENCY POLICY CHANGES
2758 The consistency policy of an active array can be changed by using the
2759 .B \-\-consistency\-policy
2760 option in Grow mode. Currently this works only for the
2764 policies and allows to enable or disable the RAID5 Partial Parity Log (PPL).
2766 .SH INCREMENTAL MODE
2770 .B mdadm \-\-incremental
2774 .RI [ optional-aliases-for-device ]
2777 .B mdadm \-\-incremental \-\-fail
2781 .B mdadm \-\-incremental \-\-rebuild\-map
2784 .B mdadm \-\-incremental \-\-run \-\-scan
2787 This mode is designed to be used in conjunction with a device
2788 discovery system. As devices are found in a system, they can be
2790 .B "mdadm \-\-incremental"
2791 to be conditionally added to an appropriate array.
2793 Conversely, it can also be used with the
2795 flag to do just the opposite and find whatever array a particular device
2796 is part of and remove the device from that array.
2798 If the device passed is a
2800 device created by a previous call to
2802 then rather than trying to add that device to an array, all the arrays
2803 described by the metadata of the container will be started.
2806 performs a number of tests to determine if the device is part of an
2807 array, and which array it should be part of. If an appropriate array
2808 is found, or can be created,
2810 adds the device to the array and conditionally starts the array.
2814 will normally only add devices to an array which were previously working
2815 (active or spare) parts of that array. The support for automatic
2816 inclusion of a new drive as a spare in some array requires
2817 a configuration through POLICY in config file.
2821 makes are as follow:
2823 Is the device permitted by
2825 That is, is it listed in a
2827 line in that file. If
2829 is absent then the default it to allow any device. Similarly if
2831 contains the special word
2833 then any device is allowed. Otherwise the device name given to
2835 or one of the aliases given, or an alias found in the filesystem,
2836 must match one of the names or patterns in a
2840 This is the only context where the aliases are used. They are
2841 usually provided by a
2844 .BR $env{DEVLINKS} .
2847 Does the device have a valid md superblock? If a specific metadata
2848 version is requested with
2852 then only that style of metadata is accepted, otherwise
2854 finds any known version of metadata. If no
2856 metadata is found, the device may be still added to an array
2857 as a spare if POLICY allows.
2861 Does the metadata match an expected array?
2862 The metadata can match in two ways. Either there is an array listed
2865 which identifies the array (either by UUID, by name, by device list,
2866 or by minor-number), or the array was created with a
2872 or on the command line.
2875 is not able to positively identify the array as belonging to the
2876 current host, the device will be rejected.
2881 keeps a list of arrays that it has partially assembled in
2883 If no array exists which matches
2884 the metadata on the new device,
2886 must choose a device name and unit number. It does this based on any
2889 or any name information stored in the metadata. If this name
2890 suggests a unit number, that number will be used, otherwise a free
2891 unit number will be chosen. Normally
2893 will prefer to create a partitionable array, however if the
2897 suggests that a non-partitionable array is preferred, that will be
2900 If the array is not found in the config file and its metadata does not
2901 identify it as belonging to the "homehost", then
2903 will choose a name for the array which is certain not to conflict with
2904 any array which does belong to this host. It does this be adding an
2905 underscore and a small number to the name preferred by the metadata.
2907 Once an appropriate array is found or created and the device is added,
2909 must decide if the array is ready to be started. It will
2910 normally compare the number of available (non-spare) devices to the
2911 number of devices that the metadata suggests need to be active. If
2912 there are at least that many, the array will be started. This means
2913 that if any devices are missing the array will not be restarted.
2919 in which case the array will be run as soon as there are enough
2920 devices present for the data to be accessible. For a RAID1, that
2921 means one device will start the array. For a clean RAID5, the array
2922 will be started as soon as all but one drive is present.
2924 Note that neither of these approaches is really ideal. If it can
2925 be known that all device discovery has completed, then
2929 can be run which will try to start all arrays that are being
2930 incrementally assembled. They are started in "read-auto" mode in
2931 which they are read-only until the first write request. This means
2932 that no metadata updates are made and no attempt at resync or recovery
2933 happens. Further devices that are found before the first write can
2934 still be added safely.
2937 This section describes environment variables that affect how mdadm
2942 Setting this value to 1 will prevent mdadm from automatically launching
2943 mdmon. This variable is intended primarily for debugging mdadm/mdmon.
2949 does not create any device nodes in /dev, but leaves that task to
2953 appears not to be configured, or if this environment variable is set
2956 will create and devices that are needed.
2959 .B MDADM_NO_SYSTEMCTL
2964 is in use it will normally request
2966 to start various background tasks (particularly
2968 rather than forking and running them in the background. This can be
2969 suppressed by setting
2970 .BR MDADM_NO_SYSTEMCTL=1 .
2974 A key value of IMSM metadata is that it allows interoperability with
2975 boot ROMs on Intel platforms, and with other major operating systems.
2978 will only allow an IMSM array to be created or modified if detects
2979 that it is running on an Intel platform which supports IMSM, and
2980 supports the particular configuration of IMSM that is being requested
2981 (some functionality requires newer OROM support).
2983 These checks can be suppressed by setting IMSM_NO_PLATFORM=1 in the
2984 environment. This can be useful for testing or for disaster
2985 recovery. You should be aware that interoperability may be
2986 compromised by setting this value.
2988 These change can also be suppressed by adding
2989 .B mdadm.imsm.test=1
2990 to the kernel command line. This makes it easy to test IMSM
2991 code in a virtual machine that doesn't have IMSM virtual hardware.
2994 .B MDADM_GROW_ALLOW_OLD
2995 If an array is stopped while it is performing a reshape and that
2996 reshape was making use of a backup file, then when the array is
2999 will sometimes complain that the backup file is too old. If this
3000 happens and you are certain it is the right backup file, you can
3001 over-ride this check by setting
3002 .B MDADM_GROW_ALLOW_OLD=1
3007 Any string given in this variable is added to the start of the
3009 line in the config file, or treated as the whole
3011 line if none is given. It can be used to disable certain metadata
3014 is called from a boot script. For example
3016 .B " export MDADM_CONF_AUTO='-ddf -imsm'
3020 does not automatically assemble any DDF or
3021 IMSM arrays that are found. This can be useful on systems configured
3022 to manage such arrays with
3028 .B " mdadm \-\-query /dev/name-of-device"
3030 This will find out if a given device is a RAID array, or is part of
3031 one, and will provide brief information about the device.
3033 .B " mdadm \-\-assemble \-\-scan"
3035 This will assemble and start all arrays listed in the standard config
3036 file. This command will typically go in a system startup file.
3038 .B " mdadm \-\-stop \-\-scan"
3040 This will shut down all arrays that can be shut down (i.e. are not
3041 currently in use). This will typically go in a system shutdown script.
3043 .B " mdadm \-\-follow \-\-scan \-\-delay=120"
3045 If (and only if) there is an Email address or program given in the
3046 standard config file, then
3047 monitor the status of all arrays listed in that file by
3048 polling them ever 2 minutes.
3050 .B " mdadm \-\-create /dev/md0 \-\-level=1 \-\-raid\-devices=2 /dev/hd[ac]1"
3052 Create /dev/md0 as a RAID1 array consisting of /dev/hda1 and /dev/hdc1.
3055 .B " echo 'DEVICE /dev/hd*[0\-9] /dev/sd*[0\-9]' > mdadm.conf"
3057 .B " mdadm \-\-detail \-\-scan >> mdadm.conf"
3059 This will create a prototype config file that describes currently
3060 active arrays that are known to be made from partitions of IDE or SCSI drives.
3061 This file should be reviewed before being used as it may
3062 contain unwanted detail.
3064 .B " echo 'DEVICE /dev/hd[a\-z] /dev/sd*[a\-z]' > mdadm.conf"
3066 .B " mdadm \-\-examine \-\-scan \-\-config=mdadm.conf >> mdadm.conf"
3068 This will find arrays which could be assembled from existing IDE and
3069 SCSI whole drives (not partitions), and store the information in the
3070 format of a config file.
3071 This file is very likely to contain unwanted detail, particularly
3074 entries. It should be reviewed and edited before being used as an
3077 .B " mdadm \-\-examine \-\-brief \-\-scan \-\-config=partitions"
3079 .B " mdadm \-Ebsc partitions"
3081 Create a list of devices by reading
3082 .BR /proc/partitions ,
3083 scan these for RAID superblocks, and printout a brief listing of all
3086 .B " mdadm \-Ac partitions \-m 0 /dev/md0"
3088 Scan all partitions and devices listed in
3089 .BR /proc/partitions
3092 out of all such devices with a RAID superblock with a minor number of 0.
3094 .B " mdadm \-\-monitor \-\-scan \-\-daemonise > /run/mdadm/mon.pid"
3096 If config file contains a mail address or alert program, run mdadm in
3097 the background in monitor mode monitoring all md devices. Also write
3098 pid of mdadm daemon to
3099 .BR /run/mdadm/mon.pid .
3101 .B " mdadm \-Iq /dev/somedevice"
3103 Try to incorporate newly discovered device into some array as
3106 .B " mdadm \-\-incremental \-\-rebuild\-map \-\-run \-\-scan"
3108 Rebuild the array map from any current arrays, and then start any that
3111 .B " mdadm /dev/md4 --fail detached --remove detached"
3113 Any devices which are components of /dev/md4 will be marked as faulty
3114 and then remove from the array.
3116 .B " mdadm --grow /dev/md4 --level=6 --backup-file=/root/backup-md4"
3120 which is currently a RAID5 array will be converted to RAID6. There
3121 should normally already be a spare drive attached to the array as a
3122 RAID6 needs one more drive than a matching RAID5.
3124 .B " mdadm --create /dev/md/ddf --metadata=ddf --raid-disks 6 /dev/sd[a-f]"
3126 Create a DDF array over 6 devices.
3128 .B " mdadm --create /dev/md/home -n3 -l5 -z 30000000 /dev/md/ddf"
3130 Create a RAID5 array over any 3 devices in the given DDF set. Use
3131 only 30 gigabytes of each device.
3133 .B " mdadm -A /dev/md/ddf1 /dev/sd[a-f]"
3135 Assemble a pre-exist ddf array.
3137 .B " mdadm -I /dev/md/ddf1"
3139 Assemble all arrays contained in the ddf array, assigning names as
3142 .B " mdadm \-\-create \-\-help"
3144 Provide help about the Create mode.
3146 .B " mdadm \-\-config \-\-help"
3148 Provide help about the format of the config file.
3150 .B " mdadm \-\-help"
3152 Provide general help.
3162 lists all active md devices with information about them.
3164 uses this to find arrays when
3166 is given in Misc mode, and to monitor array reconstruction
3169 .SS {CONFFILE} (or {CONFFILE2})
3171 Default config file. See
3175 .SS {CONFFILE}.d (or {CONFFILE2}.d)
3177 Default directory containing configuration files. See
3184 mode is used, this file gets a list of arrays currently being created.
3186 .SH POSIX PORTABLE NAME
3187 A valid name can only consist of characters "A-Za-z0-9.-_".
3188 The name cannot start with a leading "-" and cannot exceed 255 chars.
3193 understand two sorts of names for array devices.
3195 The first is the so-called 'standard' format name, which matches the
3196 names used by the kernel and which appear in
3199 The second sort can be freely chosen, but must reside in
3201 When giving a device name to
3203 to create or assemble an array, either full path name such as
3207 can be given, or just the suffix of the second sort of name, such as
3211 In every style, raw name has to be no longer than 32 chars.
3215 chooses device names during auto-assembly or incremental assembly, it
3216 will sometimes add a small sequence number to the end of the name to
3217 avoid conflicted between multiple arrays that have the same name. If
3219 can reasonably determine that the array really is meant for this host,
3220 either by a hostname in the metadata, or by the presence of the array
3223 then it will leave off the suffix if possible.
3224 Also if the homehost is specified as
3227 will only use a suffix if a different array of the same name already
3228 exists or is listed in the config file.
3230 The names for arrays are of the form:
3234 where NN is a number.
3237 Names can be non-numeric following
3244 is any string. These names are supported by
3246 since version 3.3 provided they are enabled in
3249 .SH UNDERSTANDING OUTPUT
3256 Checkpoint value is reported when array is performing some action including
3257 resync, recovery or reshape. Checkpoints allow resuming action from certain
3258 point if it was interrupted.
3260 Checkpoint is reported as combination of two values: current migration unit
3261 and number of blocks per unit. By multiplying those values and dividing by
3262 array size checkpoint progress percentage can be obtained in relation to
3263 current progress reported in /proc/mdstat. Checkpoint is also related to (and
3264 sometimes based on) sysfs entry sync_completed but depending on action units
3265 may differ. Even if units are the same, it should not be expected that
3266 checkpoint and sync_completed will be exact match nor updated simultaneously.
3270 was previously known as
3274 For further information on mdadm usage, MD and the various levels of
3277 .B https://raid.wiki.kernel.org/
3279 (based upon Jakob \(/Ostergaard's Software\-RAID.HOWTO)
3281 The latest version of
3283 should always be available from
3285 .B https://www.kernel.org/pub/linux/utils/raid/mdadm/