/etc/mdadm.conf

Although mdadm does not rely on a configuration file, using one will make array management much easier. /etc/mdadm.conf contains four types of lines that provide information to mdadm. DEVICE lines tell mdadm which block devices are member disks of an array, and ARRAY helps mdadm identify arrays that have already been created. MAILADDR and PROGRAM lines provide information about where to send email alerts and what program to execute when mdadm is monitoring arrays.

DEVICE lines

DEVICE entries have the following format:

DEVICE     device1 device2 ... deviceN

DEVICE lines can contain a complete list of individual block devices or use shell expansions to shorten the list and make managing the configuration file less tedious. In the following example, the first two ATA disks and all SCSI devices are considered potential array components:

DEVICE     /dev/hda /dev/hdb /dev/sd*

The wildcard in the previous example can also be confined to the first partition only:

DEVICE     /dev/sd*1

You might not want to scan every SCSI device, since cycling through SCSI device special files that don’t point to real disks is a waste of time. In the following example, the first two partitions of the first four SCSI disks are considered member disks:

DEVICE     /dev/sd[abcd][12]

You can also specify multiple wildcard entries on a single line. The next example includes the first partition of the first four IDE disks and the first partition of the first eight SCSI disks:

DEVICE     /dev/hd[abcd]1 /dev/sd[a-h]1

Or, give each ...

Get Managing RAID on Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.