The mdadm program controls Linux md devices (software RAID arrays)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
5.5 KiB

From 24e075c659d0a8718aabefe5af4c97195a188af7 Mon Sep 17 00:00:00 2001
From: Lukasz Florczak <>
Date: Fri, 18 Mar 2022 09:26:06 +0100
Subject: [PATCH 08/12] mdadm: Update config man regarding default files and
multi-keyword behavior
Simplify default and alternative config file and directory location references
from mdadm(8) as references to mdadm.conf(5). Add FILE section in config man
and explain order and conditions in which default and alternative config files
and directories are used.
Update config man behavior regarding parsing order when multiple keywords/config
files are involved.
Signed-off-by: Lukasz Florczak <>
Acked-by: Coly Li <>
Signed-off-by: Jes Sorensen <>
--- | 30 +++++++++-------------- | 65 ++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 71 insertions(+), 24 deletions(-)
diff --git a/ b/
index 8b21ffd4..0be02e4a 100644
--- a/
+++ b/
@@ -266,14 +266,11 @@ the exact meaning of this option in different contexts.
.BR \-c ", " \-\-config=
-Specify the config file or directory. Default is to use
-or if those are missing then
-.BR {CONFFILE2}.d .
+Specify the config file or directory. If not specified, default config file
+and default conf.d directory will be used. See
+.BR mdadm.conf (5)
+for more details.
If the config file given is
.B "partitions"
then nothing will be read, but
@@ -2013,11 +2010,9 @@ The config file is only used if explicitly named with
.B \-\-config
or requested with (a possibly implicit)
.BR \-\-scan .
-In the later case,
-is used.
+In the later case, default config file is used. See
+.BR mdadm.conf (5)
+for more details.
.B \-\-scan
@@ -3346,16 +3341,15 @@ on Monitor mode.
-The config file lists which devices may be scanned to see if
-they contain MD super block, and gives identifying information
-(e.g. UUID) about known MD arrays. See
+Default config file. See
.BR mdadm.conf (5)
for more details.
-A directory containing configuration files which are read in lexical
+Default directory containing configuration files. See
+.BR mdadm.conf (5)
+for more details.
diff --git a/ b/
index 83edd008..dd331a6a 100644
--- a/
+++ b/
@@ -88,7 +88,8 @@ but only the major and minor device numbers. It scans
.I /dev
to find the name that matches the numbers.
-If no DEVICE line is present, then "DEVICE partitions containers" is assumed.
+If no DEVICE line is present in any config file,
+then "DEVICE partitions containers" is assumed.
For example:
@@ -272,6 +273,10 @@ catenated with spaces to form the address.
Note that this value cannot be set via the
.I mdadm
commandline. It is only settable via the config file.
+There should only be one
+line and it should have only one address. Any subsequent addresses
+are silently ignored.
@@ -286,7 +291,8 @@ device.
There should only be one
.B program
-line and it should be give only one program.
+line and it should be given only one program. Any subsequent programs
+are silently ignored.
@@ -295,7 +301,14 @@ The
.B create
line gives default values to be used when creating arrays, new members
of arrays, and device entries for arrays.
-These include:
+There should only be one
+.B create
+line. Any subsequent lines will override the previous settings.
+Keywords used in the
+line and supported values are:
.RS 4
@@ -475,8 +488,8 @@ The known metadata types are
should be given at most once. Subsequent lines are silently ignored.
-Thus an earlier config file in a config directory will over-ride
-the setting in a later config file.
+Thus a later config file in a config directory will not overwrite
+the setting in an earlier config file.
@@ -594,6 +607,7 @@ The
line lists custom values of MD device's sysfs attributes which will be
stored in sysfs after the array is assembled. Multiple lines are allowed and each
line has to contain the uuid or the name of the device to which it relates.
+Lines are applied in reverse order.
.RS 4
.B uuid=
@@ -621,7 +635,46 @@ is running in
.B \-\-monitor
.B \-d/\-\-delay
-command line argument takes precedence over the config file
+command line argument takes precedence over the config file.
+If multiple
+lines are provided, only first non-zero value is considered.
+The default config file location, used when
+.I mdadm
+is running without --config option.
+The default directory with config files. Used when
+.I mdadm
+is running without --config option, after successful reading of the
+default config file. Files in that directory
+are read in lexical order.
+Alternative config file that is read, when
+.I mdadm
+is running without --config option and the
+default config file was not opened successfully.
+The alternative directory with config files. Used when
+.I mdadm
+is runninng without --config option, after reading the
+alternative config file whether it was successful or not. Files in
+that directory are read in lexical order.
DEVICE /dev/sd[bcdjkl]1