File /etc/initramfs-tools/conf.d/mdadm
(as well as other files in the /etc/initramfs-tools/conf.d/
directory) is essentially a configuration file in the format «environment variables = values», which is processed by initramfs-tools
scripts when creating the initramfs.
Main points of the syntax
-
Each line usually contains either:
- A variable assignment (for example,
BOOT_DEGRADED=true
), - Or a comment,
- Or an empty line (which the scripts ignore).
- A variable assignment (for example,
-
Variable assignments are done in the style of simple shell variables:
VARIABLE="value" VARIABLE2=yes
Double or single quotes are not mandatory if the value does not contain spaces or special characters, however, for reliability, quotes are used more often.
-
Comments are designated with the
#
symbol. Everything that follows#
in a line is ignored. For example:# This is a comment BOOT_DEGRADED=true # This is also a comment (at the end of the line)
-
Empty lines can be inserted for readability, they are ignored.
Example contents of /etc/initramfs-tools/conf.d/mdadm
# Allow booting with a "degraded" RAID array
BOOT_DEGRADED=true
# Specify that the mdadm config is in the standard location
MDADM_CONF=/etc/mdadm/mdadm.conf
At the same time, the set of available variables for the mdadm
file can differ in different distributions or versions of initramfs-tools
. The most commonly encountered ones are:
-
BOOT_DEGRADED=true|false
Indicates whether the boot process is allowed if the RAID array is not in a complete state. -
MDADM_CONF=/path/to/mdadm.conf
If there is a need to specify an alternativemdadm
configuration file. -
(In some systems)
DEVICE=...
orARRAY=...
But such settings are more often specified directly in/etc/mdadm/mdadm.conf
, rather than inconf.d/mdadm
.
How to write comments
In order to comment out a line, it is sufficient to place #
at the beginning of the line or before the text that needs to be turned into a comment. Example:
# This is a completely commented-out line
BOOT_DEGRADED=true # This is a setting with a comment at the end
Thus:
- At the beginning of the line:
# Comment
. - After a command or variable:
VARIABLE=value # explanation
.
Everything that follows the #
symbol in any line is ignored when read by the initramfs-tools
scripts.