Introduction to mdadm

The mdadm package contains administration tools for software RAID.

This package is known to build and work properly using an LFS-7.7 systemd platform.

Package Information

User Notes:

Kernel Configuration

Enable the following options in the kernel configuration and recompile the kernel, if necessary. Only the RAID types desired are required.

Device Drivers --->
  [*] Multiple devices driver support (RAID and LVM) ---> [CONFIG_MD]
    <*> RAID support                                      [CONFIG_BLK_DEV_MD]
    [*]   Autodetect RAID arrays during kernel boot       [CONFIG_MD_AUTODETECT]
    <*/M>  Linear (append) mode                           [CONFIG_MD_LINEAR]
    <*/M>  RAID-0 (striping) mode                         [CONFIG_MD_RAID0]
    <*/M>  RAID-1 (mirroring) mode                        [CONFIG_MD_RAID1]
    <*/M>  RAID-10 (mirrored striping) mode               [CONFIG_MD_RAID10]
    <*/M>  RAID-4/RAID-5/RAID-6 mode                      [CONFIG_MD_RAID456]

Installation of mdadm

First, fix problems introduced by gcc-4.9.0 and gcc-5:

sed -i 's/Wall -Werror/Wall/' Makefile &&
sed -i 's/\(^inline\)/static \1/' bitmap.c

Install mdadm by running the following commands:


If you wish to run the tests, ensure that your kernel supports RAID and that a version of mdadm is not already running, and issue: make test and then, as the root user: ./test --keep-going --logdir=tests-logs --save-logs. Some tests fail for unknown reasons.

Now, as the root user:

make install

Command Explanations

make everything: This target creates extra programs, particularly a statically-linked version of mdadm and also versions of mdassemble. These all need to be manually installed.

--keep-going: Run the tests to the end, even if one or more tests fail.

--logdir=tests-logs: Defines that the directory where tests logs are saved.

--save-logs: Instructs the test suite to save the logs.

--tests=<test1,test2,...>: Optional comma separated list of tests to be executed (all tests, if this option is not passed).


Installed Programs: mdadm, mdmon and optionally mdassemble
Installed Libraries: None
Installed Directory: None

Short Descriptions


manages MD devices aka Linux Software RAID.


monitors MD external metadata arrays.


is a tiny program that can be used to assemble MD devices inside an initial ramdisk (initrd) or initramfs.

Last updated on 2015-08-07 12:13:02 -0500