mdadm-4.0

#### Beyond Linux® From Scratch (systemd Edition) - Version 9.0

### Chapter 5. File Systems and Disk Management

- Prev

  About RAID

- Next

  ntfs-3g-2017.3.23

- Up
- Home

# mdadm-4.0

## Introduction to mdadm

The mdadm package contains administration tools for software RAID.

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

### Package Information

- Download (HTTP): https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.0.tar.xz

- Download MD5 sum: 2cb4feffea9167ba71b5f346a0c0a40d

- Download size: 424 KB

- Estimated disk space required: 6.7 MB (10 MB with tests)

- Estimated build time: less than 0.1 SBU (tests take about an hour, only partially processor dependent)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/mdadm

### Caution

Kernel versions in series 4.1 through 4.4.1 have a broken RAID implementation. Use a kernel with version at or above 4.4.2.

## 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

Fix a build error introduced by GCC-7.1:

    sed 's@-Werror@@' -i Makefile

Install mdadm by running the following commands:

    make

If you wish to run the tests, ensure that your kernel supports RAID and that a version of mdadm is not already running. As many as 9 out of 124 tests may fail.

First fix the test script to avoid a bogus error message when tests fail and build the supporting programs:

    sed -i 's# if.* == "1"#& -a -e $targetdir/log#' test &&
    make test

Run the tests as the `root` user:

    ./test --keep-going --logdir=test-logs --save-logs

Now, as the `root` user:

    make install

## Command Explanations

make everything: This optional 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=test-logs`: Defines the directory where test 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).

## Contents

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

### Short Descriptions

mdadm | manages MD devices aka Linux Software RAID.
mdmon | monitors MD external metadata arrays.
mdassemble | is a tiny program that can be used to assemble MD devices inside an initial ramdisk (initrd) or initramfs.

Last updated on 2019-08-18 18:01:59 -0700

- Prev

  About RAID

- Next

  ntfs-3g-2017.3.23

- Up
- Home