Usage: mdadm
options ... devices ...
MISC mode includes a number of distinct operations that operate
on distinct devices. The operations are:
--query
The device is examined to see if it is (1) an active md
array, or (2) a component of an md array. The information
discovered is reported.
--detail
The device should be an active md device. mdadm
will
display a detailed description of the array. --brief
or
--scan
will cause the output to be less detailed and the
format to be suitable for inclusion in mdadm.conf
. The
exit status of mdadm will normally be 0 unless mdadm
failed to get useful information about the device(s);
however, if the --test
option is given, then the exit
status will be:
0 The array is functioning normally.
1 The array has at least one failed device.
2 The array has multiple failed devices such that it
is unusable.
4 There was an error while trying to get information
about the device.
--detail-platform
Print detail of the platform's RAID capabilities (firmware
/ hardware topology). If the metadata is specified with
-e
or --metadata=
then the return status will be:
0 metadata successfully enumerated its platform
components on this system
1 metadata is platform independent
2 metadata failed to find its platform components on
this system
--update-subarray=
If the device is a container and the argument to
--update-subarray specifies a subarray in the container,
then attempt to update the given superblock field in the
subarray. Similar to updating an array in "assemble"
mode, the field to update is selected by -U
or --update=
option. The supported options are name
, ppl
, no-ppl
,
bitmap
and no-bitmap
.
The name
option updates the subarray name in the metadata,
it may not affect the device node name or the device node
symlink until the subarray is re-assembled. If updating
name
would change the UUID of an active subarray this
operation is blocked, and the command will end in an
error.
The ppl
and no-ppl
options enable and disable PPL in the
metadata. Currently supported only for IMSM subarrays.
The bitmap
and no-bitmap
options enable and disable write-
intent bitmap in the metadata. Currently supported only
for IMSM subarrays.
--examine
The device should be a component of an md array. mdadm
will read the md superblock of the device and display the
contents. If --brief
or --scan
is given, then multiple
devices that are components of the one array are grouped
together and reported in a single entry suitable for
inclusion in mdadm.conf
.
Having --scan
without listing any devices will cause all
devices listed in the config file to be examined.
--dump=
directory
If the device contains RAID metadata, a file will be
created in the directory and the metadata will be written
to it. The file will be the same size as the device and
have the metadata written in the file at the same locate
that it exists in the device. However the file will be
"sparse" so that only those blocks containing metadata
will be allocated. The total space used will be small.
The file name used in the directory will be the base name
of the device. Further if any links appear in
/dev/disk/by-id which point to the device, then hard links
to the file will be created in directory based on these
by-id names.
Multiple devices can be listed and their metadata will all
be stored in the one directory.
--restore=
directory
This is the reverse of --dump
. mdadm will locate a file
in the directory that has a name appropriate for the given
device and will restore metadata from it. Names that
match /dev/disk/by-id names are preferred, however if two
of those refer to different files, mdadm will not choose
between them but will abort the operation.
If a file name is given instead of a directory then mdadm
will restore from that file to a single device, always
provided the size of the file matches that of the device,
and the file contains valid metadata.
--stop
The devices should be active md arrays which will be
deactivated, as long as they are not currently in use.
--run
This will fully activate a partially assembled md array.
--readonly
This will mark an active array as read-only, providing
that it is not currently being used.
--readwrite
This will change a readonly
array back to being
read/write.
--scan
For all operations except --examine
, --scan
will cause the
operation to be applied to all arrays listed in
/proc/mdstat
. For --examine, --scan
causes all devices
listed in the config file to be examined.
-b
, --brief
Be less verbose. This is used with --detail
and
--examine
. Using --brief
with --verbose
gives an
intermediate level of verbosity.