управлять MD-устройствами, также известными как Linux Software RAID (manage MD devices aka Linux Software RAID)
Режимы (Modes)
mdadm has several major modes of operation:
Assemble
Assemble the components of a previously created array into
an active array. Components can be explicitly given or
can be searched for. mdadm checks that the components do
form a bona fide array, and can, on request, fiddle
superblock information so as to assemble a faulty array.
Build
Build an array that doesn't have per-device metadata
(superblocks). For these sorts of arrays, mdadm cannot
differentiate between initial creation and subsequent
assembly of an array. It also cannot perform any checks
that appropriate components have been requested. Because
of this, the Build
mode should only be used together with
a complete understanding of what you are doing.
Create
Create a new array with per-device metadata (superblocks).
Appropriate metadata is written to each device, and then
the array comprising those devices is activated. A
'resync' process is started to make sure that the array is
consistent (e.g. both sides of a mirror contain the same
data) but the content of the device is left otherwise
untouched. The array can be used as soon as it has been
created. There is no need to wait for the initial resync
to finish.
Follow or Monitor
Monitor one or more md devices and act on any state
changes. This is only meaningful for RAID1, 4, 5, 6, 10
or multipath arrays, as only these have interesting state.
RAID0 or Linear never have missing, spare, or failed
drives, so there is nothing to monitor.
Grow
Grow (or shrink) an array, or otherwise reshape it in some
way. Currently supported growth options including
changing the active size of component devices and changing
the number of active devices in Linear and RAID levels
0/1/4/5/6, changing the RAID level between 0, 1, 5, and 6,
and between 0 and 10, changing the chunk size and layout
for RAID 0,4,5,6,10 as well as adding or removing a write-
intent bitmap and changing the array's consistency policy.
Incremental Assembly
Add a single device to an appropriate array. If the
addition of the device makes the array runnable, the array
will be started. This provides a convenient interface to
a hot-plug system. As each device is detected, mdadm has
a chance to include it in some array as appropriate.
Optionally, when the --fail flag is passed in we will
remove the device from any active array instead of adding
it.
If a CONTAINER
is passed to mdadm in this mode, then any
arrays within that container will be assembled and
started.
Manage
This is for doing things to specific components of an
array such as adding new spares and removing faulty
devices.
Misc
This is an 'everything else' mode that supports operations
on active arrays, operations on component devices such as
erasing old superblocks, and information gathering
operations.
Auto-detect
This mode does not act on a specific device or array, but
rather it requests the Linux Kernel to activate any auto-
detected arrays.