Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [77]

By Root 1326 0
this case, the magic number is used to let programs like raidtools or mdadm know that a particular disk block marks the beginning of the RAID superblock. The number itself, in this case, is arbitrary and simply acts as a marker. See the magic number entry in the jargon file 4.3.1 for more information: http://www.tuxedo.org/jargon/html/entry/magic-number.html.

/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 entry its own line:

DEVICE /dev/hdb1

# /dev/sdb1 /dev/sdc1 and /dev/sdd1

DEVICE /dev/sd[bcd]1

# /dev/sdk1 /dev/sdk2 /dev/sdl1 /dev/sdl2 /dev/sdm1

# and/dev/sdm2

DEVICE /dev/sd[klm][12]

DEVICE lines can be shortened using the abbreviation DEV. For example:

DEV /dev/hd[abcd]1

ARRAY lines

ARRAY lines are bit different from DEVICE lines, in that they have two fields, an md device name, and a list of identification information:

ARRAY mddevice idtype=info idtype=info ... idtype=info

Valid identifier types are as follows:

uuid=

A 128-bit hexadecimal number that matches the UUID stored in the RAID superblock. A separator may appear after every 4 bits, but is not necessary. Use mdadm -D to determine the UUID of an active array. In this example, the separator appears after every 32 bits: uuid=6055c0b4:c3ec7631:c069b1fc:695acc70.

super-minor=

The array's minor number, as stored in the RAID superblock (for example, super-minor=0). The minor number is written to the superblock when the array is created. In general, if an array was created on /dev/md0, the minor number is 0, and so on. However, if arrays are started on different md devices than the ones on which they were originally created, the minor number still remains the same.

devices=

A comma-separated list of devices that make up the array (for example, devices=/dev/sda, /dev/sdb, /dev/sdc). Devices listed in a device identifier must also appear on a DEVICE line.

level=

The RAID level of the array (for example, level=1). This option is only included for compatibility with the output of mdadm --examine --scan.

num-devices=

The total number of devices in an array (for example, num-devices=6). This is also used for compatibility with mdadm --examine --scan.

spare-group=

The identifier used by mdadm when in monitor mode to keep track of moveable spare disks (for example, spare-group=database). The value is an arbitrary text mnemonic. mdadm will move spare disks, as needed, between arrays that are in the same spare group.

A typical entry using a UUID is:

ARRAY /dev/md0 UUID=ea3cb40f:b0bb05c1:b6525f1c:bf21268e

An ARRAY line that uses the minor number:

ARRAY /dev/md0 superminor=0

The

Return Main Page Previous Page Next Page

®Online Book Reader