Blame SOURCES/0006-mdadm-Respect-config-file-location-in-man.patch

fdf7c0
From e9dd5644843e2013a7dd1a8a5da2b9fa35837416 Mon Sep 17 00:00:00 2001
fdf7c0
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
fdf7c0
Date: Fri, 18 Mar 2022 09:26:04 +0100
fdf7c0
Subject: [PATCH 06/12] mdadm: Respect config file location in man
fdf7c0
fdf7c0
Default config file location could differ depending on OS (e.g. Debian family).
fdf7c0
This patch takes default config file into consideration when creating mdadm.man
fdf7c0
file as well as mdadm.conf.man.
fdf7c0
fdf7c0
Rename mdadm.conf.5 to mdadm.conf.5.in. Now mdadm.conf.5 is generated automatically.
fdf7c0
fdf7c0
Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com>
fdf7c0
Acked-by: Coly Li <colyli@suse.de>
fdf7c0
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
fdf7c0
---
fdf7c0
 .gitignore      |   1 +
fdf7c0
 Makefile        |   7 +-
fdf7c0
 mdadm.8.in      |  16 +-
fdf7c0
 mdadm.conf.5    | 706 ------------------------------------------------
fdf7c0
 mdadm.conf.5.in | 706 ++++++++++++++++++++++++++++++++++++++++++++++++
fdf7c0
 5 files changed, 721 insertions(+), 715 deletions(-)
fdf7c0
 delete mode 100644 mdadm.conf.5
fdf7c0
 create mode 100644 mdadm.conf.5.in
fdf7c0
fdf7c0
diff --git a/.gitignore b/.gitignore
fdf7c0
index 217fe76d..8d791c6f 100644
fdf7c0
--- a/.gitignore
fdf7c0
+++ b/.gitignore
fdf7c0
@@ -3,6 +3,7 @@
fdf7c0
 /*-stamp
fdf7c0
 /mdadm
fdf7c0
 /mdadm.8
fdf7c0
+/mdadm.conf.5
fdf7c0
 /mdadm.udeb
fdf7c0
 /mdassemble
fdf7c0
 /mdmon
fdf7c0
diff --git a/Makefile b/Makefile
fdf7c0
index 2a51d813..bf126033 100644
fdf7c0
--- a/Makefile
fdf7c0
+++ b/Makefile
fdf7c0
@@ -227,7 +227,12 @@ raid6check : raid6check.o mdadm.h $(CHECK_OBJS)
fdf7c0
 
fdf7c0
 mdadm.8 : mdadm.8.in
fdf7c0
 	sed -e 's/{DEFAULT_METADATA}/$(DEFAULT_METADATA)/g' \
fdf7c0
-	-e 's,{MAP_PATH},$(MAP_PATH),g'  mdadm.8.in > mdadm.8
fdf7c0
+	-e 's,{MAP_PATH},$(MAP_PATH),g' -e 's,{CONFFILE},$(CONFFILE),g' \
fdf7c0
+	-e 's,{CONFFILE2},$(CONFFILE2),g'  mdadm.8.in > mdadm.8
fdf7c0
+
fdf7c0
+mdadm.conf.5 : mdadm.conf.5.in
fdf7c0
+	sed -e 's,{CONFFILE},$(CONFFILE),g' \
fdf7c0
+	-e 's,{CONFFILE2},$(CONFFILE2),g'  mdadm.conf.5.in > mdadm.conf.5
fdf7c0
 
fdf7c0
 mdadm.man : mdadm.8
fdf7c0
 	man -l mdadm.8 > mdadm.man
fdf7c0
diff --git a/mdadm.8.in b/mdadm.8.in
fdf7c0
index e2a42425..8b21ffd4 100644
fdf7c0
--- a/mdadm.8.in
fdf7c0
+++ b/mdadm.8.in
fdf7c0
@@ -267,13 +267,13 @@ the exact meaning of this option in different contexts.
fdf7c0
 .TP
fdf7c0
 .BR \-c ", " \-\-config=
fdf7c0
 Specify the config file or directory.  Default is to use
fdf7c0
-.B /etc/mdadm.conf
fdf7c0
+.B {CONFFILE}
fdf7c0
 and
fdf7c0
-.BR /etc/mdadm.conf.d ,
fdf7c0
+.BR {CONFFILE}.d ,
fdf7c0
 or if those are missing then
fdf7c0
-.B /etc/mdadm/mdadm.conf
fdf7c0
+.B {CONFFILE2}
fdf7c0
 and
fdf7c0
-.BR /etc/mdadm/mdadm.conf.d .
fdf7c0
+.BR {CONFFILE2}.d .
fdf7c0
 If the config file given is
fdf7c0
 .B "partitions"
fdf7c0
 then nothing will be read, but
fdf7c0
@@ -2014,9 +2014,9 @@ The config file is only used if explicitly named with
fdf7c0
 or requested with (a possibly implicit)
fdf7c0
 .BR \-\-scan .
fdf7c0
 In the later case,
fdf7c0
-.B /etc/mdadm.conf
fdf7c0
+.B {CONFFILE}
fdf7c0
 or
fdf7c0
-.B /etc/mdadm/mdadm.conf
fdf7c0
+.B {CONFFILE2}
fdf7c0
 is used.
fdf7c0
 
fdf7c0
 If
fdf7c0
@@ -3344,7 +3344,7 @@ uses this to find arrays when
fdf7c0
 is given in Misc mode, and to monitor array reconstruction
fdf7c0
 on Monitor mode.
fdf7c0
 
fdf7c0
-.SS /etc/mdadm.conf
fdf7c0
+.SS {CONFFILE} (or {CONFFILE2})
fdf7c0
 
fdf7c0
 The config file lists which devices may be scanned to see if
fdf7c0
 they contain MD super block, and gives identifying information
fdf7c0
@@ -3352,7 +3352,7 @@ they contain MD super block, and gives identifying information
fdf7c0
 .BR mdadm.conf (5)
fdf7c0
 for more details.
fdf7c0
 
fdf7c0
-.SS /etc/mdadm.conf.d
fdf7c0
+.SS {CONFFILE}.d (or {CONFFILE2}.d)
fdf7c0
 
fdf7c0
 A directory containing configuration files which are read in lexical
fdf7c0
 order.
fdf7c0
diff --git a/mdadm.conf.5 b/mdadm.conf.5
fdf7c0
deleted file mode 100644
fdf7c0
index 74a21c5f..00000000
fdf7c0
--- a/mdadm.conf.5
fdf7c0
+++ /dev/null
fdf7c0
@@ -1,706 +0,0 @@
fdf7c0
-.\" Copyright Neil Brown and others.
fdf7c0
-.\"   This program is free software; you can redistribute it and/or modify
fdf7c0
-.\"   it under the terms of the GNU General Public License as published by
fdf7c0
-.\"   the Free Software Foundation; either version 2 of the License, or
fdf7c0
-.\"   (at your option) any later version.
fdf7c0
-.\" See file COPYING in distribution for details.
fdf7c0
-.TH MDADM.CONF 5
fdf7c0
-.SH NAME
fdf7c0
-mdadm.conf \- configuration for management of Software RAID with mdadm
fdf7c0
-.SH SYNOPSIS
fdf7c0
-/etc/mdadm.conf
fdf7c0
-.SH DESCRIPTION
fdf7c0
-.PP
fdf7c0
-.I mdadm
fdf7c0
-is a tool for creating, managing, and monitoring RAID devices using the
fdf7c0
-.B md
fdf7c0
-driver in Linux.
fdf7c0
-.PP
fdf7c0
-Some common tasks, such as assembling all arrays, can be simplified
fdf7c0
-by describing the devices and arrays in this configuration file.
fdf7c0
-
fdf7c0
-.SS SYNTAX
fdf7c0
-The file should be seen as a collection of words separated by white
fdf7c0
-space (space, tab, or newline).
fdf7c0
-Any word that beings with a hash sign (#) starts a comment and that
fdf7c0
-word together with the remainder of the line is ignored.
fdf7c0
-
fdf7c0
-Spaces can be included in a word using quotation characters.  Either
fdf7c0
-single quotes
fdf7c0
-.RB ( ' )
fdf7c0
-or double quotes (\fB"\fP)
fdf7c0
-may be used.  All the characters from one quotation character to
fdf7c0
-next identical character are protected and will not be used to
fdf7c0
-separate words to start new quoted strings.  To include a single quote
fdf7c0
-it must be between double quotes.  To include a double quote it must
fdf7c0
-be between single quotes.
fdf7c0
-
fdf7c0
-Any line that starts with white space (space or tab) is treated as
fdf7c0
-though it were a continuation of the previous line.
fdf7c0
-
fdf7c0
-Empty lines are ignored, but otherwise each (non continuation) line
fdf7c0
-must start with a keyword as listed below.  The keywords are case
fdf7c0
-insensitive and can be abbreviated to 3 characters.
fdf7c0
-
fdf7c0
-The keywords are:
fdf7c0
-.TP
fdf7c0
-.B DEVICE
fdf7c0
-A
fdf7c0
-.B device
fdf7c0
-line lists the devices (whole devices or partitions) that might contain
fdf7c0
-a component of an MD array.  When looking for the components of an
fdf7c0
-array,
fdf7c0
-.I mdadm
fdf7c0
-will scan these devices (or any devices listed on the command line).
fdf7c0
-
fdf7c0
-The
fdf7c0
-.B device
fdf7c0
-line may contain a number of different devices (separated by spaces)
fdf7c0
-and each device name can contain wild cards as defined by
fdf7c0
-.BR glob (7).
fdf7c0
-
fdf7c0
-Also, there may be several device lines present in the file.
fdf7c0
-
fdf7c0
-Alternatively, a
fdf7c0
-.B device
fdf7c0
-line can contain either or both of the  words
fdf7c0
-.B containers
fdf7c0
-and
fdf7c0
-.BR partitions .
fdf7c0
-The word
fdf7c0
-.B containers
fdf7c0
-will cause
fdf7c0
-.I mdadm
fdf7c0
-to look for assembled CONTAINER arrays and included them as a source
fdf7c0
-for assembling further arrays.
fdf7c0
-
fdf7c0
-The word
fdf7c0
-.I partitions
fdf7c0
-will cause
fdf7c0
-.I mdadm
fdf7c0
-to read
fdf7c0
-.I /proc/partitions
fdf7c0
-and include all devices and partitions found therein.
fdf7c0
-.I mdadm
fdf7c0
-does not use the names from
fdf7c0
-.I /proc/partitions
fdf7c0
-but only the major and minor device numbers.  It scans
fdf7c0
-.I /dev
fdf7c0
-to find the name that matches the numbers.
fdf7c0
-
fdf7c0
-If no DEVICE line is present, then "DEVICE partitions containers" is assumed.
fdf7c0
-
fdf7c0
-For example:
fdf7c0
-.IP
fdf7c0
-DEVICE /dev/hda* /dev/hdc*
fdf7c0
-.br
fdf7c0
-DEV    /dev/sd*
fdf7c0
-.br
fdf7c0
-DEVICE /dev/disk/by-path/pci*
fdf7c0
-.br
fdf7c0
-DEVICE partitions
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B ARRAY
fdf7c0
-The ARRAY lines identify actual arrays.  The second word on the line
fdf7c0
-may be the name of the device where the array is normally
fdf7c0
-assembled, such as
fdf7c0
-.B /dev/md1
fdf7c0
-or
fdf7c0
-.BR /dev/md/backup .
fdf7c0
-If the name does not start with a slash
fdf7c0
-.RB (' / '),
fdf7c0
-it is treated as being in
fdf7c0
-.BR /dev/md/ .
fdf7c0
-Alternately the word
fdf7c0
-.B <ignore>
fdf7c0
-(complete with angle brackets) can be given in which case any array
fdf7c0
-which matches the rest of the line will never be automatically assembled.
fdf7c0
-If no device name is given,
fdf7c0
-.I mdadm
fdf7c0
-will use various heuristics to determine an appropriate name.
fdf7c0
-
fdf7c0
-Subsequent words identify the array, or identify the array as a member
fdf7c0
-of a group. If multiple identities are given,
fdf7c0
-then a component device must match ALL identities to be considered a
fdf7c0
-match.  Each identity word has a tag, and equals sign, and some value.
fdf7c0
-The tags are:
fdf7c0
-.RS 4
fdf7c0
-.TP
fdf7c0
-.B uuid=
fdf7c0
-The value should be a 128 bit uuid in hexadecimal, with punctuation
fdf7c0
-interspersed if desired.  This must match the uuid stored in the
fdf7c0
-superblock.
fdf7c0
-.TP
fdf7c0
-.B name=
fdf7c0
-The value should be a simple textual name as was given to
fdf7c0
-.I mdadm
fdf7c0
-when the array was created.  This must match the name stored in the
fdf7c0
-superblock on a device for that device to be included in the array.
fdf7c0
-Not all superblock formats support names.
fdf7c0
-.TP
fdf7c0
-.B super\-minor=
fdf7c0
-The value is an integer which indicates the minor number that was
fdf7c0
-stored in the superblock when the array was created. When an array is
fdf7c0
-created as /dev/mdX, then the minor number X is stored.
fdf7c0
-.TP
fdf7c0
-.B devices=
fdf7c0
-The value is a comma separated list of device names or device name
fdf7c0
-patterns.
fdf7c0
-Only devices with names which match one entry in the list will be used
fdf7c0
-to assemble the array.  Note that the devices
fdf7c0
-listed there must also be listed on a DEVICE line.
fdf7c0
-.TP
fdf7c0
-.B level=
fdf7c0
-The value is a RAID level.  This is not normally used to
fdf7c0
-identify an array, but is supported so that the output of
fdf7c0
-
fdf7c0
-.B "mdadm \-\-examine \-\-scan"
fdf7c0
-
fdf7c0
-can be use directly in the configuration file.
fdf7c0
-.TP
fdf7c0
-.B num\-devices=
fdf7c0
-The value is the number of devices in a complete active array.  As with
fdf7c0
-.B level=
fdf7c0
-this is mainly for compatibility with the output of
fdf7c0
-
fdf7c0
-.BR "mdadm \-\-examine \-\-scan" .
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B spares=
fdf7c0
-The value is a number of spare devices to expect the array to have.
fdf7c0
-The sole use of this keyword and value is as follows:
fdf7c0
-.B mdadm \-\-monitor
fdf7c0
-will report an array if it is found to have fewer than this number of
fdf7c0
-spares when
fdf7c0
-.B \-\-monitor
fdf7c0
-starts or when
fdf7c0
-.B \-\-oneshot
fdf7c0
-is used.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B spare\-group=
fdf7c0
-The value is a textual name for a group of arrays.  All arrays with
fdf7c0
-the same
fdf7c0
-.B spare\-group
fdf7c0
-name are considered to be part of the same group.  The significance of
fdf7c0
-a group of arrays is that
fdf7c0
-.I mdadm
fdf7c0
-will, when monitoring the arrays, move a spare drive from one array in
fdf7c0
-a group to another array in that group if the first array had a failed
fdf7c0
-or missing drive but no spare.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B auto=
fdf7c0
-This option is rarely needed with mdadm-3.0, particularly if use with
fdf7c0
-the Linux kernel v2.6.28 or later.
fdf7c0
-It tells
fdf7c0
-.I mdadm
fdf7c0
-whether to use partitionable array or non-partitionable arrays and,
fdf7c0
-in the absence of
fdf7c0
-.IR udev ,
fdf7c0
-how many partition devices to create.  From 2.6.28 all md array
fdf7c0
-devices are partitionable, hence this option is not needed.
fdf7c0
-
fdf7c0
-The value of this option can be "yes" or "md" to indicate that a
fdf7c0
-traditional, non-partitionable md array should be created, or "mdp",
fdf7c0
-"part" or "partition" to indicate that a partitionable md array (only
fdf7c0
-available in linux 2.6 and later) should be used.  This later set can
fdf7c0
-also have a number appended to indicate how many partitions to create
fdf7c0
-device files for, e.g.
fdf7c0
-.BR auto=mdp5 .
fdf7c0
-The default is 4.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B bitmap=
fdf7c0
-The option specifies a file in which a write-intent bitmap should be
fdf7c0
-found.  When assembling the array,
fdf7c0
-.I mdadm
fdf7c0
-will provide this file to the
fdf7c0
-.B md
fdf7c0
-driver as the bitmap file.  This has the same function as the
fdf7c0
-.B \-\-bitmap\-file
fdf7c0
-option to
fdf7c0
-.BR \-\-assemble .
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B metadata=
fdf7c0
-Specify the metadata format that the array has.  This is mainly
fdf7c0
-recognised for comparability with the output of
fdf7c0
-.BR "mdadm \-Es" .
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B container=
fdf7c0
-Specify that this array is a member array of some container.  The
fdf7c0
-value given can be either a path name in /dev, or a UUID of the
fdf7c0
-container array.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B member=
fdf7c0
-Specify that this array is a member array of some container.  Each
fdf7c0
-type of container has some way to enumerate member arrays, often a
fdf7c0
-simple sequence number.  The value identifies which member of a
fdf7c0
-container the array is.  It will usually accompany a "container=" word.
fdf7c0
-.RE
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B MAILADDR
fdf7c0
-The
fdf7c0
-.B mailaddr
fdf7c0
-line gives an E-mail address that alerts should be
fdf7c0
-sent to when
fdf7c0
-.I mdadm
fdf7c0
-is running in
fdf7c0
-.B \-\-monitor
fdf7c0
-mode (and was given the
fdf7c0
-.B \-\-scan
fdf7c0
-option).  There should only be one
fdf7c0
-.B MAILADDR
fdf7c0
-line and it should have only one address.  Any subsequent addresses
fdf7c0
-are silently ignored.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B MAILFROM
fdf7c0
-The
fdf7c0
-.B mailfrom
fdf7c0
-line (which can only be abbreviated to at least 5 characters) gives an
fdf7c0
-address to appear in the "From" address for alert mails.  This can be
fdf7c0
-useful if you want to explicitly set a domain, as the default from
fdf7c0
-address is "root" with no domain.  All words on this line are
fdf7c0
-catenated with spaces to form the address.
fdf7c0
-
fdf7c0
-Note that this value cannot be set via the
fdf7c0
-.I mdadm
fdf7c0
-commandline.  It is only settable via the config file.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B PROGRAM
fdf7c0
-The
fdf7c0
-.B program
fdf7c0
-line gives the name of a program to be run when
fdf7c0
-.B "mdadm \-\-monitor"
fdf7c0
-detects potentially interesting events on any of the arrays that it
fdf7c0
-is monitoring.  This program gets run with two or three arguments, they
fdf7c0
-being the Event, the md device, and possibly the related component
fdf7c0
-device.
fdf7c0
-
fdf7c0
-There should only be one
fdf7c0
-.B program
fdf7c0
-line and it should be give only one program.
fdf7c0
-
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B CREATE
fdf7c0
-The
fdf7c0
-.B create
fdf7c0
-line gives default values to be used when creating arrays, new members
fdf7c0
-of arrays, and device entries for arrays.
fdf7c0
-These include:
fdf7c0
-
fdf7c0
-.RS 4
fdf7c0
-.TP
fdf7c0
-.B owner=
fdf7c0
-.TP
fdf7c0
-.B group=
fdf7c0
-These can give user/group ids or names to use instead of system
fdf7c0
-defaults (root/wheel or root/disk).
fdf7c0
-.TP
fdf7c0
-.B mode=
fdf7c0
-An octal file mode such as 0660 can be given to override the default
fdf7c0
-of 0600.
fdf7c0
-.TP
fdf7c0
-.B auto=
fdf7c0
-This corresponds to the
fdf7c0
-.B \-\-auto
fdf7c0
-flag to mdadm.  Give
fdf7c0
-.BR yes ,
fdf7c0
-.BR md ,
fdf7c0
-.BR mdp ,
fdf7c0
-.B part
fdf7c0
-\(em possibly followed by a number of partitions \(em to indicate how
fdf7c0
-missing device entries should be created.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B metadata=
fdf7c0
-The name of the metadata format to use if none is explicitly given.
fdf7c0
-This can be useful to impose a system-wide default of version-1 superblocks.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B symlinks=no
fdf7c0
-Normally when creating devices in
fdf7c0
-.B /dev/md/
fdf7c0
-.I mdadm
fdf7c0
-will create a matching symlink from
fdf7c0
-.B /dev/
fdf7c0
-with a name starting
fdf7c0
-.B md
fdf7c0
-or
fdf7c0
-.BR md_ .
fdf7c0
-Give
fdf7c0
-.B symlinks=no
fdf7c0
-to suppress this symlink creation.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B names=yes
fdf7c0
-Since Linux 2.6.29 it has been possible to create
fdf7c0
-.B md
fdf7c0
-devices with a name like
fdf7c0
-.B md_home
fdf7c0
-rather than just a number, like
fdf7c0
-.BR md3 .
fdf7c0
-.I mdadm
fdf7c0
-will use the numeric alternative by default as other tools that interact
fdf7c0
-with md arrays may expect only numbers.
fdf7c0
-If
fdf7c0
-.B names=yes
fdf7c0
-is given in
fdf7c0
-.I mdadm.conf
fdf7c0
-then
fdf7c0
-.I mdadm
fdf7c0
-will use a name when appropriate.
fdf7c0
-If
fdf7c0
-.B names=no
fdf7c0
-is given, then non-numeric
fdf7c0
-.I md
fdf7c0
-device names will not be used even if the default changes in a future
fdf7c0
-release of
fdf7c0
-.IR mdadm .
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B bbl=no
fdf7c0
-By default,
fdf7c0
-.I mdadm
fdf7c0
-will reserve space for a bad block list (bbl) on all devices
fdf7c0
-included in or added to any array that supports them.  Setting
fdf7c0
-.B bbl=no
fdf7c0
-will prevent this, so newly added devices will not have a bad
fdf7c0
-block log.
fdf7c0
-.RE
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B HOMEHOST
fdf7c0
-The
fdf7c0
-.B homehost
fdf7c0
-line gives a default value for the
fdf7c0
-.B \-\-homehost=
fdf7c0
-option to mdadm.  There should normally be only one other word on the line.
fdf7c0
-It should either be a host name, or one of the special words
fdf7c0
-.BR <system>,
fdf7c0
-.B <none>
fdf7c0
-and
fdf7c0
-.BR <ignore> .
fdf7c0
-If
fdf7c0
-.B <system>
fdf7c0
-is given, then the
fdf7c0
-.BR gethostname ( 2 )
fdf7c0
-systemcall is used to get the host name.  This is the default.
fdf7c0
-
fdf7c0
-If
fdf7c0
-.B <ignore>
fdf7c0
-is given, then a flag is set so that when arrays are being
fdf7c0
-auto-assembled the checking of the recorded
fdf7c0
-.I homehost
fdf7c0
-is disabled.
fdf7c0
-If
fdf7c0
-.B <ignore>
fdf7c0
-is given it is also possible to give an explicit name which will be
fdf7c0
-used when creating arrays.  This is the only case when there can be
fdf7c0
-more that one other word on the
fdf7c0
-.B HOMEHOST
fdf7c0
-line.  If there are other words, or other
fdf7c0
-.B HOMEHOST
fdf7c0
-lines, they are silently ignored.
fdf7c0
-
fdf7c0
-If
fdf7c0
-.B <none>
fdf7c0
-is given, then the default of using
fdf7c0
-.BR gethostname ( 2 )
fdf7c0
-is over-ridden and no homehost name is assumed.
fdf7c0
-
fdf7c0
-When arrays are created, this host name will be stored in the
fdf7c0
-metadata.  When arrays are assembled using auto-assembly, arrays which
fdf7c0
-do not record the correct homehost name in their metadata will be
fdf7c0
-assembled using a "foreign" name.  A "foreign" name alway ends with a
fdf7c0
-digit string preceded by an underscore to differentiate it
fdf7c0
-from any possible local name. e.g.
fdf7c0
-.B /dev/md/1_1
fdf7c0
-or
fdf7c0
-.BR /dev/md/home_0 .
fdf7c0
-.TP
fdf7c0
-.B AUTO
fdf7c0
-A list of names of metadata format can be given, each preceded by a
fdf7c0
-plus or minus sign.  Also the word
fdf7c0
-.I homehost
fdf7c0
-is allowed as is
fdf7c0
-.I all
fdf7c0
-preceded by plus or minus sign.
fdf7c0
-.I all
fdf7c0
-is usually last.
fdf7c0
-
fdf7c0
-When
fdf7c0
-.I mdadm
fdf7c0
-is auto-assembling an array, either via
fdf7c0
-.I \-\-assemble
fdf7c0
-or
fdf7c0
-.I \-\-incremental
fdf7c0
-and it finds metadata of a given type, it checks that metadata type
fdf7c0
-against those listed in this line.  The first match wins, where
fdf7c0
-.I all
fdf7c0
-matches anything.
fdf7c0
-If a match is found that was preceded by a plus sign, the auto
fdf7c0
-assembly is allowed.  If the match was preceded by a minus sign, the
fdf7c0
-auto assembly is disallowed.  If no match is found, the auto assembly
fdf7c0
-is allowed.
fdf7c0
-
fdf7c0
-If the metadata indicates that the array was created for
fdf7c0
-.I this
fdf7c0
-host, and the word
fdf7c0
-.I homehost
fdf7c0
-appears before any other match, then the array is treated as a valid
fdf7c0
-candidate for auto-assembly.
fdf7c0
-
fdf7c0
-This can be used to disable all auto-assembly (so that only arrays
fdf7c0
-explicitly listed in mdadm.conf or on the command line are assembled),
fdf7c0
-or to disable assembly of certain metadata types which might be
fdf7c0
-handled by other software.  It can also be used to disable assembly of
fdf7c0
-all foreign arrays - normally such arrays are assembled but given a
fdf7c0
-non-deterministic name in
fdf7c0
-.BR /dev/md/ .
fdf7c0
-
fdf7c0
-The known metadata types are
fdf7c0
-.BR 0.90 ,
fdf7c0
-.BR 1.x ,
fdf7c0
-.BR ddf ,
fdf7c0
-.BR imsm .
fdf7c0
-
fdf7c0
-.B AUTO
fdf7c0
-should be given at most once.  Subsequent lines are silently ignored.
fdf7c0
-Thus an earlier config file in a config directory will over-ride
fdf7c0
-the setting in a later config file.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B POLICY
fdf7c0
-This is used to specify what automatic behavior is allowed on devices
fdf7c0
-newly appearing in the system and provides a way of marking spares that can
fdf7c0
-be moved to other arrays as well as the migration domains.
fdf7c0
-.I Domain
fdf7c0
-can be defined through
fdf7c0
-.I policy
fdf7c0
-line by specifying a domain name for a number of paths from
fdf7c0
-.BR /dev/disk/by-path/ .
fdf7c0
-A device may belong to several domains. The domain of an array is a union
fdf7c0
-of domains of all devices in that array.  A spare can be automatically
fdf7c0
-moved from one array to another if the set of the destination array's
fdf7c0
-.I domains
fdf7c0
-contains all the
fdf7c0
-.I domains
fdf7c0
-of the new disk or if both arrays have the same
fdf7c0
-.IR spare-group .
fdf7c0
-
fdf7c0
-To update hot plug configuration it is necessary to execute
fdf7c0
-.B mdadm \-\-udev\-rules
fdf7c0
-command after changing the config file
fdf7c0
-
fdf7c0
-Keywords used in the
fdf7c0
-.I POLICY
fdf7c0
-line and supported values are:
fdf7c0
-
fdf7c0
-.RS 4
fdf7c0
-.TP
fdf7c0
-.B domain=
fdf7c0
-any arbitrary string
fdf7c0
-.TP
fdf7c0
-.B metadata=
fdf7c0
-0.9 1.x ddf or imsm
fdf7c0
-.TP
fdf7c0
-.B path=
fdf7c0
-file glob matching anything from
fdf7c0
-.B /dev/disk/by-path
fdf7c0
-.TP
fdf7c0
-.B type=
fdf7c0
-either
fdf7c0
-.B disk
fdf7c0
-or
fdf7c0
-.BR part .
fdf7c0
-.TP
fdf7c0
-.B action=
fdf7c0
-include, re-add, spare, spare-same-slot, or force-spare
fdf7c0
-.TP
fdf7c0
-.B auto=
fdf7c0
-yes, no, or homehost.
fdf7c0
-
fdf7c0
-.P
fdf7c0
-The
fdf7c0
-.I action
fdf7c0
-item determines the automatic behavior allowed for devices matching the
fdf7c0
-.I path
fdf7c0
-and
fdf7c0
-.I type
fdf7c0
-in the same line.  If a device matches several lines with different
fdf7c0
-.I  actions
fdf7c0
-then the most permissive will apply. The ordering of policy lines
fdf7c0
-is irrelevant to the end result.
fdf7c0
-.TP
fdf7c0
-.B include
fdf7c0
-allows adding a disk to an array if metadata on that disk matches that array
fdf7c0
-.TP
fdf7c0
-.B re\-add
fdf7c0
-will include the device in the array if it appears to be a current member
fdf7c0
-or a member that was recently removed and the array has a
fdf7c0
-write-intent-bitmap to allow the
fdf7c0
-.B re\-add
fdf7c0
-functionality.
fdf7c0
-.TP
fdf7c0
-.B spare
fdf7c0
-as above and additionally: if the device is bare it can
fdf7c0
-become a spare if there is any array that it is a candidate for based
fdf7c0
-on domains and metadata.
fdf7c0
-.TP
fdf7c0
-.B spare\-same\-slot
fdf7c0
-as above and additionally if given slot was used by an array that went
fdf7c0
-degraded recently and the device plugged in has no metadata then it will
fdf7c0
-be automatically added to that array (or it's container)
fdf7c0
-.TP
fdf7c0
-.B force\-spare
fdf7c0
-as above and the disk will become a spare in remaining cases
fdf7c0
-.RE
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B PART-POLICY
fdf7c0
-This is similar to
fdf7c0
-.B POLICY
fdf7c0
-and accepts the same keyword assignments.  It allows a consistent set
fdf7c0
-of policies to applied to each of the partitions of a device.
fdf7c0
-
fdf7c0
-A
fdf7c0
-.B PART-POLICY
fdf7c0
-line should set
fdf7c0
-.I type=disk
fdf7c0
-and identify the path to one or more disk devices.  Each partition on
fdf7c0
-these disks will be treated according to the
fdf7c0
-.I action=
fdf7c0
-setting  from this line.  If a
fdf7c0
-.I domain
fdf7c0
-is set in the line, then the domain associated with each patition will
fdf7c0
-be based on the domain, but with
fdf7c0
-.RB \(dq -part N\(dq
fdf7c0
-appended, when N is the partition number for the partition that was
fdf7c0
-found.
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B SYSFS
fdf7c0
-The
fdf7c0
-.B SYSFS
fdf7c0
-line lists custom values of MD device's sysfs attributes which will be
fdf7c0
-stored in sysfs after the array is assembled. Multiple lines are allowed and each
fdf7c0
-line has to contain the uuid or the name of the device to which it relates.
fdf7c0
-.RS 4
fdf7c0
-.TP
fdf7c0
-.B uuid=
fdf7c0
-hexadecimal identifier of MD device. This has to match the uuid stored in the
fdf7c0
-superblock.
fdf7c0
-.TP
fdf7c0
-.B name=
fdf7c0
-name of the MD device as was given to
fdf7c0
-.I mdadm
fdf7c0
-when the array was created. It will be ignored if
fdf7c0
-.B uuid
fdf7c0
-is not empty.
fdf7c0
-.RE
fdf7c0
-
fdf7c0
-.TP
fdf7c0
-.B MONITORDELAY
fdf7c0
-The
fdf7c0
-.B monitordelay
fdf7c0
-line gives a delay in seconds
fdf7c0
-.I mdadm
fdf7c0
-shall wait before pooling md arrays
fdf7c0
-when
fdf7c0
-.I mdadm
fdf7c0
-is running in
fdf7c0
-.B \-\-monitor
fdf7c0
-mode.
fdf7c0
-.B \-d/\-\-delay
fdf7c0
-command line argument takes precedence over the config file
fdf7c0
-
fdf7c0
-.SH EXAMPLE
fdf7c0
-DEVICE /dev/sd[bcdjkl]1
fdf7c0
-.br
fdf7c0
-DEVICE /dev/hda1 /dev/hdb1
fdf7c0
-
fdf7c0
-# /dev/md0 is known by its UUID.
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
fdf7c0
-.br
fdf7c0
-# /dev/md1 contains all devices with a minor number of
fdf7c0
-.br
fdf7c0
-#   1 in the superblock.
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md1 superminor=1
fdf7c0
-.br
fdf7c0
-# /dev/md2 is made from precisely these two devices
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
fdf7c0
-
fdf7c0
-# /dev/md4 and /dev/md5 are a spare-group and spares
fdf7c0
-.br
fdf7c0
-#  can be moved between them
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
fdf7c0
-.br
fdf7c0
-           spare\-group=group1
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
fdf7c0
-.br
fdf7c0
-           spare\-group=group1
fdf7c0
-.br
fdf7c0
-# /dev/md/home is created if need to be a partitionable md array
fdf7c0
-.br
fdf7c0
-# any spare device number is allocated.
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
fdf7c0
-.br
fdf7c0
-           auto=part
fdf7c0
-.br
fdf7c0
-# The name of this array contains a space.
fdf7c0
-.br
fdf7c0
-ARRAY /dev/md9 name='Data Storage'
fdf7c0
-.sp
fdf7c0
-POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*
fdf7c0
-.br
fdf7c0
-           action=spare
fdf7c0
-.br
fdf7c0
-POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*
fdf7c0
-.br
fdf7c0
-           action=include
fdf7c0
-.br
fdf7c0
-# One domain comprising of devices attached to specified paths is defined.
fdf7c0
-.br
fdf7c0
-# Bare device matching first path will be made an imsm spare on hot plug.
fdf7c0
-.br
fdf7c0
-# If more than one array is created on devices belonging to domain1 and
fdf7c0
-.br
fdf7c0
-# one of them becomes degraded, then any imsm spare matching any path for
fdf7c0
-.br
fdf7c0
-# given domain name can be migrated.
fdf7c0
-.br
fdf7c0
-MAILADDR root@mydomain.tld
fdf7c0
-.br
fdf7c0
-PROGRAM /usr/sbin/handle\-mdadm\-events
fdf7c0
-.br
fdf7c0
-CREATE group=system mode=0640 auto=part\-8
fdf7c0
-.br
fdf7c0
-HOMEHOST <system>
fdf7c0
-.br
fdf7c0
-AUTO +1.x homehost \-all
fdf7c0
-.br
fdf7c0
-SYSFS name=/dev/md/raid5 group_thread_cnt=4 sync_speed_max=1000000
fdf7c0
-.br
fdf7c0
-SYSFS uuid=bead5eb6:31c17a27:da120ba2:7dfda40d group_thread_cnt=4
fdf7c0
-sync_speed_max=1000000
fdf7c0
-.br
fdf7c0
-MONITORDELAY 60
fdf7c0
-
fdf7c0
-.SH SEE ALSO
fdf7c0
-.BR mdadm (8),
fdf7c0
-.BR md (4).
fdf7c0
diff --git a/mdadm.conf.5.in b/mdadm.conf.5.in
fdf7c0
new file mode 100644
fdf7c0
index 00000000..83edd008
fdf7c0
--- /dev/null
fdf7c0
+++ b/mdadm.conf.5.in
fdf7c0
@@ -0,0 +1,706 @@
fdf7c0
+.\" Copyright Neil Brown and others.
fdf7c0
+.\"   This program is free software; you can redistribute it and/or modify
fdf7c0
+.\"   it under the terms of the GNU General Public License as published by
fdf7c0
+.\"   the Free Software Foundation; either version 2 of the License, or
fdf7c0
+.\"   (at your option) any later version.
fdf7c0
+.\" See file COPYING in distribution for details.
fdf7c0
+.TH MDADM.CONF 5
fdf7c0
+.SH NAME
fdf7c0
+mdadm.conf \- configuration for management of Software RAID with mdadm
fdf7c0
+.SH SYNOPSIS
fdf7c0
+{CONFFILE}
fdf7c0
+.SH DESCRIPTION
fdf7c0
+.PP
fdf7c0
+.I mdadm
fdf7c0
+is a tool for creating, managing, and monitoring RAID devices using the
fdf7c0
+.B md
fdf7c0
+driver in Linux.
fdf7c0
+.PP
fdf7c0
+Some common tasks, such as assembling all arrays, can be simplified
fdf7c0
+by describing the devices and arrays in this configuration file.
fdf7c0
+
fdf7c0
+.SS SYNTAX
fdf7c0
+The file should be seen as a collection of words separated by white
fdf7c0
+space (space, tab, or newline).
fdf7c0
+Any word that beings with a hash sign (#) starts a comment and that
fdf7c0
+word together with the remainder of the line is ignored.
fdf7c0
+
fdf7c0
+Spaces can be included in a word using quotation characters.  Either
fdf7c0
+single quotes
fdf7c0
+.RB ( ' )
fdf7c0
+or double quotes (\fB"\fP)
fdf7c0
+may be used.  All the characters from one quotation character to
fdf7c0
+next identical character are protected and will not be used to
fdf7c0
+separate words to start new quoted strings.  To include a single quote
fdf7c0
+it must be between double quotes.  To include a double quote it must
fdf7c0
+be between single quotes.
fdf7c0
+
fdf7c0
+Any line that starts with white space (space or tab) is treated as
fdf7c0
+though it were a continuation of the previous line.
fdf7c0
+
fdf7c0
+Empty lines are ignored, but otherwise each (non continuation) line
fdf7c0
+must start with a keyword as listed below.  The keywords are case
fdf7c0
+insensitive and can be abbreviated to 3 characters.
fdf7c0
+
fdf7c0
+The keywords are:
fdf7c0
+.TP
fdf7c0
+.B DEVICE
fdf7c0
+A
fdf7c0
+.B device
fdf7c0
+line lists the devices (whole devices or partitions) that might contain
fdf7c0
+a component of an MD array.  When looking for the components of an
fdf7c0
+array,
fdf7c0
+.I mdadm
fdf7c0
+will scan these devices (or any devices listed on the command line).
fdf7c0
+
fdf7c0
+The
fdf7c0
+.B device
fdf7c0
+line may contain a number of different devices (separated by spaces)
fdf7c0
+and each device name can contain wild cards as defined by
fdf7c0
+.BR glob (7).
fdf7c0
+
fdf7c0
+Also, there may be several device lines present in the file.
fdf7c0
+
fdf7c0
+Alternatively, a
fdf7c0
+.B device
fdf7c0
+line can contain either or both of the  words
fdf7c0
+.B containers
fdf7c0
+and
fdf7c0
+.BR partitions .
fdf7c0
+The word
fdf7c0
+.B containers
fdf7c0
+will cause
fdf7c0
+.I mdadm
fdf7c0
+to look for assembled CONTAINER arrays and included them as a source
fdf7c0
+for assembling further arrays.
fdf7c0
+
fdf7c0
+The word
fdf7c0
+.I partitions
fdf7c0
+will cause
fdf7c0
+.I mdadm
fdf7c0
+to read
fdf7c0
+.I /proc/partitions
fdf7c0
+and include all devices and partitions found therein.
fdf7c0
+.I mdadm
fdf7c0
+does not use the names from
fdf7c0
+.I /proc/partitions
fdf7c0
+but only the major and minor device numbers.  It scans
fdf7c0
+.I /dev
fdf7c0
+to find the name that matches the numbers.
fdf7c0
+
fdf7c0
+If no DEVICE line is present, then "DEVICE partitions containers" is assumed.
fdf7c0
+
fdf7c0
+For example:
fdf7c0
+.IP
fdf7c0
+DEVICE /dev/hda* /dev/hdc*
fdf7c0
+.br
fdf7c0
+DEV    /dev/sd*
fdf7c0
+.br
fdf7c0
+DEVICE /dev/disk/by-path/pci*
fdf7c0
+.br
fdf7c0
+DEVICE partitions
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B ARRAY
fdf7c0
+The ARRAY lines identify actual arrays.  The second word on the line
fdf7c0
+may be the name of the device where the array is normally
fdf7c0
+assembled, such as
fdf7c0
+.B /dev/md1
fdf7c0
+or
fdf7c0
+.BR /dev/md/backup .
fdf7c0
+If the name does not start with a slash
fdf7c0
+.RB (' / '),
fdf7c0
+it is treated as being in
fdf7c0
+.BR /dev/md/ .
fdf7c0
+Alternately the word
fdf7c0
+.B <ignore>
fdf7c0
+(complete with angle brackets) can be given in which case any array
fdf7c0
+which matches the rest of the line will never be automatically assembled.
fdf7c0
+If no device name is given,
fdf7c0
+.I mdadm
fdf7c0
+will use various heuristics to determine an appropriate name.
fdf7c0
+
fdf7c0
+Subsequent words identify the array, or identify the array as a member
fdf7c0
+of a group. If multiple identities are given,
fdf7c0
+then a component device must match ALL identities to be considered a
fdf7c0
+match.  Each identity word has a tag, and equals sign, and some value.
fdf7c0
+The tags are:
fdf7c0
+.RS 4
fdf7c0
+.TP
fdf7c0
+.B uuid=
fdf7c0
+The value should be a 128 bit uuid in hexadecimal, with punctuation
fdf7c0
+interspersed if desired.  This must match the uuid stored in the
fdf7c0
+superblock.
fdf7c0
+.TP
fdf7c0
+.B name=
fdf7c0
+The value should be a simple textual name as was given to
fdf7c0
+.I mdadm
fdf7c0
+when the array was created.  This must match the name stored in the
fdf7c0
+superblock on a device for that device to be included in the array.
fdf7c0
+Not all superblock formats support names.
fdf7c0
+.TP
fdf7c0
+.B super\-minor=
fdf7c0
+The value is an integer which indicates the minor number that was
fdf7c0
+stored in the superblock when the array was created. When an array is
fdf7c0
+created as /dev/mdX, then the minor number X is stored.
fdf7c0
+.TP
fdf7c0
+.B devices=
fdf7c0
+The value is a comma separated list of device names or device name
fdf7c0
+patterns.
fdf7c0
+Only devices with names which match one entry in the list will be used
fdf7c0
+to assemble the array.  Note that the devices
fdf7c0
+listed there must also be listed on a DEVICE line.
fdf7c0
+.TP
fdf7c0
+.B level=
fdf7c0
+The value is a RAID level.  This is not normally used to
fdf7c0
+identify an array, but is supported so that the output of
fdf7c0
+
fdf7c0
+.B "mdadm \-\-examine \-\-scan"
fdf7c0
+
fdf7c0
+can be use directly in the configuration file.
fdf7c0
+.TP
fdf7c0
+.B num\-devices=
fdf7c0
+The value is the number of devices in a complete active array.  As with
fdf7c0
+.B level=
fdf7c0
+this is mainly for compatibility with the output of
fdf7c0
+
fdf7c0
+.BR "mdadm \-\-examine \-\-scan" .
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B spares=
fdf7c0
+The value is a number of spare devices to expect the array to have.
fdf7c0
+The sole use of this keyword and value is as follows:
fdf7c0
+.B mdadm \-\-monitor
fdf7c0
+will report an array if it is found to have fewer than this number of
fdf7c0
+spares when
fdf7c0
+.B \-\-monitor
fdf7c0
+starts or when
fdf7c0
+.B \-\-oneshot
fdf7c0
+is used.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B spare\-group=
fdf7c0
+The value is a textual name for a group of arrays.  All arrays with
fdf7c0
+the same
fdf7c0
+.B spare\-group
fdf7c0
+name are considered to be part of the same group.  The significance of
fdf7c0
+a group of arrays is that
fdf7c0
+.I mdadm
fdf7c0
+will, when monitoring the arrays, move a spare drive from one array in
fdf7c0
+a group to another array in that group if the first array had a failed
fdf7c0
+or missing drive but no spare.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B auto=
fdf7c0
+This option is rarely needed with mdadm-3.0, particularly if use with
fdf7c0
+the Linux kernel v2.6.28 or later.
fdf7c0
+It tells
fdf7c0
+.I mdadm
fdf7c0
+whether to use partitionable array or non-partitionable arrays and,
fdf7c0
+in the absence of
fdf7c0
+.IR udev ,
fdf7c0
+how many partition devices to create.  From 2.6.28 all md array
fdf7c0
+devices are partitionable, hence this option is not needed.
fdf7c0
+
fdf7c0
+The value of this option can be "yes" or "md" to indicate that a
fdf7c0
+traditional, non-partitionable md array should be created, or "mdp",
fdf7c0
+"part" or "partition" to indicate that a partitionable md array (only
fdf7c0
+available in linux 2.6 and later) should be used.  This later set can
fdf7c0
+also have a number appended to indicate how many partitions to create
fdf7c0
+device files for, e.g.
fdf7c0
+.BR auto=mdp5 .
fdf7c0
+The default is 4.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B bitmap=
fdf7c0
+The option specifies a file in which a write-intent bitmap should be
fdf7c0
+found.  When assembling the array,
fdf7c0
+.I mdadm
fdf7c0
+will provide this file to the
fdf7c0
+.B md
fdf7c0
+driver as the bitmap file.  This has the same function as the
fdf7c0
+.B \-\-bitmap\-file
fdf7c0
+option to
fdf7c0
+.BR \-\-assemble .
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B metadata=
fdf7c0
+Specify the metadata format that the array has.  This is mainly
fdf7c0
+recognised for comparability with the output of
fdf7c0
+.BR "mdadm \-Es" .
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B container=
fdf7c0
+Specify that this array is a member array of some container.  The
fdf7c0
+value given can be either a path name in /dev, or a UUID of the
fdf7c0
+container array.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B member=
fdf7c0
+Specify that this array is a member array of some container.  Each
fdf7c0
+type of container has some way to enumerate member arrays, often a
fdf7c0
+simple sequence number.  The value identifies which member of a
fdf7c0
+container the array is.  It will usually accompany a "container=" word.
fdf7c0
+.RE
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B MAILADDR
fdf7c0
+The
fdf7c0
+.B mailaddr
fdf7c0
+line gives an E-mail address that alerts should be
fdf7c0
+sent to when
fdf7c0
+.I mdadm
fdf7c0
+is running in
fdf7c0
+.B \-\-monitor
fdf7c0
+mode (and was given the
fdf7c0
+.B \-\-scan
fdf7c0
+option).  There should only be one
fdf7c0
+.B MAILADDR
fdf7c0
+line and it should have only one address.  Any subsequent addresses
fdf7c0
+are silently ignored.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B MAILFROM
fdf7c0
+The
fdf7c0
+.B mailfrom
fdf7c0
+line (which can only be abbreviated to at least 5 characters) gives an
fdf7c0
+address to appear in the "From" address for alert mails.  This can be
fdf7c0
+useful if you want to explicitly set a domain, as the default from
fdf7c0
+address is "root" with no domain.  All words on this line are
fdf7c0
+catenated with spaces to form the address.
fdf7c0
+
fdf7c0
+Note that this value cannot be set via the
fdf7c0
+.I mdadm
fdf7c0
+commandline.  It is only settable via the config file.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B PROGRAM
fdf7c0
+The
fdf7c0
+.B program
fdf7c0
+line gives the name of a program to be run when
fdf7c0
+.B "mdadm \-\-monitor"
fdf7c0
+detects potentially interesting events on any of the arrays that it
fdf7c0
+is monitoring.  This program gets run with two or three arguments, they
fdf7c0
+being the Event, the md device, and possibly the related component
fdf7c0
+device.
fdf7c0
+
fdf7c0
+There should only be one
fdf7c0
+.B program
fdf7c0
+line and it should be give only one program.
fdf7c0
+
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B CREATE
fdf7c0
+The
fdf7c0
+.B create
fdf7c0
+line gives default values to be used when creating arrays, new members
fdf7c0
+of arrays, and device entries for arrays.
fdf7c0
+These include:
fdf7c0
+
fdf7c0
+.RS 4
fdf7c0
+.TP
fdf7c0
+.B owner=
fdf7c0
+.TP
fdf7c0
+.B group=
fdf7c0
+These can give user/group ids or names to use instead of system
fdf7c0
+defaults (root/wheel or root/disk).
fdf7c0
+.TP
fdf7c0
+.B mode=
fdf7c0
+An octal file mode such as 0660 can be given to override the default
fdf7c0
+of 0600.
fdf7c0
+.TP
fdf7c0
+.B auto=
fdf7c0
+This corresponds to the
fdf7c0
+.B \-\-auto
fdf7c0
+flag to mdadm.  Give
fdf7c0
+.BR yes ,
fdf7c0
+.BR md ,
fdf7c0
+.BR mdp ,
fdf7c0
+.B part
fdf7c0
+\(em possibly followed by a number of partitions \(em to indicate how
fdf7c0
+missing device entries should be created.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B metadata=
fdf7c0
+The name of the metadata format to use if none is explicitly given.
fdf7c0
+This can be useful to impose a system-wide default of version-1 superblocks.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B symlinks=no
fdf7c0
+Normally when creating devices in
fdf7c0
+.B /dev/md/
fdf7c0
+.I mdadm
fdf7c0
+will create a matching symlink from
fdf7c0
+.B /dev/
fdf7c0
+with a name starting
fdf7c0
+.B md
fdf7c0
+or
fdf7c0
+.BR md_ .
fdf7c0
+Give
fdf7c0
+.B symlinks=no
fdf7c0
+to suppress this symlink creation.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B names=yes
fdf7c0
+Since Linux 2.6.29 it has been possible to create
fdf7c0
+.B md
fdf7c0
+devices with a name like
fdf7c0
+.B md_home
fdf7c0
+rather than just a number, like
fdf7c0
+.BR md3 .
fdf7c0
+.I mdadm
fdf7c0
+will use the numeric alternative by default as other tools that interact
fdf7c0
+with md arrays may expect only numbers.
fdf7c0
+If
fdf7c0
+.B names=yes
fdf7c0
+is given in
fdf7c0
+.I mdadm.conf
fdf7c0
+then
fdf7c0
+.I mdadm
fdf7c0
+will use a name when appropriate.
fdf7c0
+If
fdf7c0
+.B names=no
fdf7c0
+is given, then non-numeric
fdf7c0
+.I md
fdf7c0
+device names will not be used even if the default changes in a future
fdf7c0
+release of
fdf7c0
+.IR mdadm .
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B bbl=no
fdf7c0
+By default,
fdf7c0
+.I mdadm
fdf7c0
+will reserve space for a bad block list (bbl) on all devices
fdf7c0
+included in or added to any array that supports them.  Setting
fdf7c0
+.B bbl=no
fdf7c0
+will prevent this, so newly added devices will not have a bad
fdf7c0
+block log.
fdf7c0
+.RE
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B HOMEHOST
fdf7c0
+The
fdf7c0
+.B homehost
fdf7c0
+line gives a default value for the
fdf7c0
+.B \-\-homehost=
fdf7c0
+option to mdadm.  There should normally be only one other word on the line.
fdf7c0
+It should either be a host name, or one of the special words
fdf7c0
+.BR <system>,
fdf7c0
+.B <none>
fdf7c0
+and
fdf7c0
+.BR <ignore> .
fdf7c0
+If
fdf7c0
+.B <system>
fdf7c0
+is given, then the
fdf7c0
+.BR gethostname ( 2 )
fdf7c0
+systemcall is used to get the host name.  This is the default.
fdf7c0
+
fdf7c0
+If
fdf7c0
+.B <ignore>
fdf7c0
+is given, then a flag is set so that when arrays are being
fdf7c0
+auto-assembled the checking of the recorded
fdf7c0
+.I homehost
fdf7c0
+is disabled.
fdf7c0
+If
fdf7c0
+.B <ignore>
fdf7c0
+is given it is also possible to give an explicit name which will be
fdf7c0
+used when creating arrays.  This is the only case when there can be
fdf7c0
+more that one other word on the
fdf7c0
+.B HOMEHOST
fdf7c0
+line.  If there are other words, or other
fdf7c0
+.B HOMEHOST
fdf7c0
+lines, they are silently ignored.
fdf7c0
+
fdf7c0
+If
fdf7c0
+.B <none>
fdf7c0
+is given, then the default of using
fdf7c0
+.BR gethostname ( 2 )
fdf7c0
+is over-ridden and no homehost name is assumed.
fdf7c0
+
fdf7c0
+When arrays are created, this host name will be stored in the
fdf7c0
+metadata.  When arrays are assembled using auto-assembly, arrays which
fdf7c0
+do not record the correct homehost name in their metadata will be
fdf7c0
+assembled using a "foreign" name.  A "foreign" name alway ends with a
fdf7c0
+digit string preceded by an underscore to differentiate it
fdf7c0
+from any possible local name. e.g.
fdf7c0
+.B /dev/md/1_1
fdf7c0
+or
fdf7c0
+.BR /dev/md/home_0 .
fdf7c0
+.TP
fdf7c0
+.B AUTO
fdf7c0
+A list of names of metadata format can be given, each preceded by a
fdf7c0
+plus or minus sign.  Also the word
fdf7c0
+.I homehost
fdf7c0
+is allowed as is
fdf7c0
+.I all
fdf7c0
+preceded by plus or minus sign.
fdf7c0
+.I all
fdf7c0
+is usually last.
fdf7c0
+
fdf7c0
+When
fdf7c0
+.I mdadm
fdf7c0
+is auto-assembling an array, either via
fdf7c0
+.I \-\-assemble
fdf7c0
+or
fdf7c0
+.I \-\-incremental
fdf7c0
+and it finds metadata of a given type, it checks that metadata type
fdf7c0
+against those listed in this line.  The first match wins, where
fdf7c0
+.I all
fdf7c0
+matches anything.
fdf7c0
+If a match is found that was preceded by a plus sign, the auto
fdf7c0
+assembly is allowed.  If the match was preceded by a minus sign, the
fdf7c0
+auto assembly is disallowed.  If no match is found, the auto assembly
fdf7c0
+is allowed.
fdf7c0
+
fdf7c0
+If the metadata indicates that the array was created for
fdf7c0
+.I this
fdf7c0
+host, and the word
fdf7c0
+.I homehost
fdf7c0
+appears before any other match, then the array is treated as a valid
fdf7c0
+candidate for auto-assembly.
fdf7c0
+
fdf7c0
+This can be used to disable all auto-assembly (so that only arrays
fdf7c0
+explicitly listed in mdadm.conf or on the command line are assembled),
fdf7c0
+or to disable assembly of certain metadata types which might be
fdf7c0
+handled by other software.  It can also be used to disable assembly of
fdf7c0
+all foreign arrays - normally such arrays are assembled but given a
fdf7c0
+non-deterministic name in
fdf7c0
+.BR /dev/md/ .
fdf7c0
+
fdf7c0
+The known metadata types are
fdf7c0
+.BR 0.90 ,
fdf7c0
+.BR 1.x ,
fdf7c0
+.BR ddf ,
fdf7c0
+.BR imsm .
fdf7c0
+
fdf7c0
+.B AUTO
fdf7c0
+should be given at most once.  Subsequent lines are silently ignored.
fdf7c0
+Thus an earlier config file in a config directory will over-ride
fdf7c0
+the setting in a later config file.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B POLICY
fdf7c0
+This is used to specify what automatic behavior is allowed on devices
fdf7c0
+newly appearing in the system and provides a way of marking spares that can
fdf7c0
+be moved to other arrays as well as the migration domains.
fdf7c0
+.I Domain
fdf7c0
+can be defined through
fdf7c0
+.I policy
fdf7c0
+line by specifying a domain name for a number of paths from
fdf7c0
+.BR /dev/disk/by-path/ .
fdf7c0
+A device may belong to several domains. The domain of an array is a union
fdf7c0
+of domains of all devices in that array.  A spare can be automatically
fdf7c0
+moved from one array to another if the set of the destination array's
fdf7c0
+.I domains
fdf7c0
+contains all the
fdf7c0
+.I domains
fdf7c0
+of the new disk or if both arrays have the same
fdf7c0
+.IR spare-group .
fdf7c0
+
fdf7c0
+To update hot plug configuration it is necessary to execute
fdf7c0
+.B mdadm \-\-udev\-rules
fdf7c0
+command after changing the config file
fdf7c0
+
fdf7c0
+Keywords used in the
fdf7c0
+.I POLICY
fdf7c0
+line and supported values are:
fdf7c0
+
fdf7c0
+.RS 4
fdf7c0
+.TP
fdf7c0
+.B domain=
fdf7c0
+any arbitrary string
fdf7c0
+.TP
fdf7c0
+.B metadata=
fdf7c0
+0.9 1.x ddf or imsm
fdf7c0
+.TP
fdf7c0
+.B path=
fdf7c0
+file glob matching anything from
fdf7c0
+.B /dev/disk/by-path
fdf7c0
+.TP
fdf7c0
+.B type=
fdf7c0
+either
fdf7c0
+.B disk
fdf7c0
+or
fdf7c0
+.BR part .
fdf7c0
+.TP
fdf7c0
+.B action=
fdf7c0
+include, re-add, spare, spare-same-slot, or force-spare
fdf7c0
+.TP
fdf7c0
+.B auto=
fdf7c0
+yes, no, or homehost.
fdf7c0
+
fdf7c0
+.P
fdf7c0
+The
fdf7c0
+.I action
fdf7c0
+item determines the automatic behavior allowed for devices matching the
fdf7c0
+.I path
fdf7c0
+and
fdf7c0
+.I type
fdf7c0
+in the same line.  If a device matches several lines with different
fdf7c0
+.I  actions
fdf7c0
+then the most permissive will apply. The ordering of policy lines
fdf7c0
+is irrelevant to the end result.
fdf7c0
+.TP
fdf7c0
+.B include
fdf7c0
+allows adding a disk to an array if metadata on that disk matches that array
fdf7c0
+.TP
fdf7c0
+.B re\-add
fdf7c0
+will include the device in the array if it appears to be a current member
fdf7c0
+or a member that was recently removed and the array has a
fdf7c0
+write-intent-bitmap to allow the
fdf7c0
+.B re\-add
fdf7c0
+functionality.
fdf7c0
+.TP
fdf7c0
+.B spare
fdf7c0
+as above and additionally: if the device is bare it can
fdf7c0
+become a spare if there is any array that it is a candidate for based
fdf7c0
+on domains and metadata.
fdf7c0
+.TP
fdf7c0
+.B spare\-same\-slot
fdf7c0
+as above and additionally if given slot was used by an array that went
fdf7c0
+degraded recently and the device plugged in has no metadata then it will
fdf7c0
+be automatically added to that array (or it's container)
fdf7c0
+.TP
fdf7c0
+.B force\-spare
fdf7c0
+as above and the disk will become a spare in remaining cases
fdf7c0
+.RE
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B PART-POLICY
fdf7c0
+This is similar to
fdf7c0
+.B POLICY
fdf7c0
+and accepts the same keyword assignments.  It allows a consistent set
fdf7c0
+of policies to applied to each of the partitions of a device.
fdf7c0
+
fdf7c0
+A
fdf7c0
+.B PART-POLICY
fdf7c0
+line should set
fdf7c0
+.I type=disk
fdf7c0
+and identify the path to one or more disk devices.  Each partition on
fdf7c0
+these disks will be treated according to the
fdf7c0
+.I action=
fdf7c0
+setting  from this line.  If a
fdf7c0
+.I domain
fdf7c0
+is set in the line, then the domain associated with each patition will
fdf7c0
+be based on the domain, but with
fdf7c0
+.RB \(dq -part N\(dq
fdf7c0
+appended, when N is the partition number for the partition that was
fdf7c0
+found.
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B SYSFS
fdf7c0
+The
fdf7c0
+.B SYSFS
fdf7c0
+line lists custom values of MD device's sysfs attributes which will be
fdf7c0
+stored in sysfs after the array is assembled. Multiple lines are allowed and each
fdf7c0
+line has to contain the uuid or the name of the device to which it relates.
fdf7c0
+.RS 4
fdf7c0
+.TP
fdf7c0
+.B uuid=
fdf7c0
+hexadecimal identifier of MD device. This has to match the uuid stored in the
fdf7c0
+superblock.
fdf7c0
+.TP
fdf7c0
+.B name=
fdf7c0
+name of the MD device as was given to
fdf7c0
+.I mdadm
fdf7c0
+when the array was created. It will be ignored if
fdf7c0
+.B uuid
fdf7c0
+is not empty.
fdf7c0
+.RE
fdf7c0
+
fdf7c0
+.TP
fdf7c0
+.B MONITORDELAY
fdf7c0
+The
fdf7c0
+.B monitordelay
fdf7c0
+line gives a delay in seconds
fdf7c0
+.I mdadm
fdf7c0
+shall wait before pooling md arrays
fdf7c0
+when
fdf7c0
+.I mdadm
fdf7c0
+is running in
fdf7c0
+.B \-\-monitor
fdf7c0
+mode.
fdf7c0
+.B \-d/\-\-delay
fdf7c0
+command line argument takes precedence over the config file
fdf7c0
+
fdf7c0
+.SH EXAMPLE
fdf7c0
+DEVICE /dev/sd[bcdjkl]1
fdf7c0
+.br
fdf7c0
+DEVICE /dev/hda1 /dev/hdb1
fdf7c0
+
fdf7c0
+# /dev/md0 is known by its UUID.
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
fdf7c0
+.br
fdf7c0
+# /dev/md1 contains all devices with a minor number of
fdf7c0
+.br
fdf7c0
+#   1 in the superblock.
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md1 superminor=1
fdf7c0
+.br
fdf7c0
+# /dev/md2 is made from precisely these two devices
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
fdf7c0
+
fdf7c0
+# /dev/md4 and /dev/md5 are a spare-group and spares
fdf7c0
+.br
fdf7c0
+#  can be moved between them
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df
fdf7c0
+.br
fdf7c0
+           spare\-group=group1
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977
fdf7c0
+.br
fdf7c0
+           spare\-group=group1
fdf7c0
+.br
fdf7c0
+# /dev/md/home is created if need to be a partitionable md array
fdf7c0
+.br
fdf7c0
+# any spare device number is allocated.
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b
fdf7c0
+.br
fdf7c0
+           auto=part
fdf7c0
+.br
fdf7c0
+# The name of this array contains a space.
fdf7c0
+.br
fdf7c0
+ARRAY /dev/md9 name='Data Storage'
fdf7c0
+.sp
fdf7c0
+POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*
fdf7c0
+.br
fdf7c0
+           action=spare
fdf7c0
+.br
fdf7c0
+POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*
fdf7c0
+.br
fdf7c0
+           action=include
fdf7c0
+.br
fdf7c0
+# One domain comprising of devices attached to specified paths is defined.
fdf7c0
+.br
fdf7c0
+# Bare device matching first path will be made an imsm spare on hot plug.
fdf7c0
+.br
fdf7c0
+# If more than one array is created on devices belonging to domain1 and
fdf7c0
+.br
fdf7c0
+# one of them becomes degraded, then any imsm spare matching any path for
fdf7c0
+.br
fdf7c0
+# given domain name can be migrated.
fdf7c0
+.br
fdf7c0
+MAILADDR root@mydomain.tld
fdf7c0
+.br
fdf7c0
+PROGRAM /usr/sbin/handle\-mdadm\-events
fdf7c0
+.br
fdf7c0
+CREATE group=system mode=0640 auto=part\-8
fdf7c0
+.br
fdf7c0
+HOMEHOST <system>
fdf7c0
+.br
fdf7c0
+AUTO +1.x homehost \-all
fdf7c0
+.br
fdf7c0
+SYSFS name=/dev/md/raid5 group_thread_cnt=4 sync_speed_max=1000000
fdf7c0
+.br
fdf7c0
+SYSFS uuid=bead5eb6:31c17a27:da120ba2:7dfda40d group_thread_cnt=4
fdf7c0
+sync_speed_max=1000000
fdf7c0
+.br
fdf7c0
+MONITORDELAY 60
fdf7c0
+
fdf7c0
+.SH SEE ALSO
fdf7c0
+.BR mdadm (8),
fdf7c0
+.BR md (4).
fdf7c0
-- 
fdf7c0
2.31.1
fdf7c0