Managing Software RAIDs 6 and 10 with mdadm

This section describes how to create software RAID 6 and 10 devices, using the Multiple Devices Administration (mdadm(8)) tool. You can also use mdadm to create RAIDs 0, 1, 4, and 5. The mdadm tool provides the functionality of legacy programs mdtools and raidtools.

Creating a RAID 6

Understanding RAID 6

RAID 6 is essentially an extension of RAID 5 that allows for additional fault tolerance by using a second independent distributed parity scheme (dual parity). Even if one of the hard disk drives fails during the data recovery process, the system continues to be operational, with no data loss.

RAID6 provides for extremely high data fault tolerance by sustaining multiple simultaneous drive failures. It handles the loss of any two devices without data loss. Accordingly, it requires N+2 drives to store N drives worth of data. It requires a minimum of 4 devices.

The performance for RAID 6 is slightly lower but comparable to RAID 5 in normal mode and single disk failure mode. It is very slow in dual disk failure mode.

Table 7.1. Comparison of RAID 5 and RAID 6

Feature

RAID 5

RAID 6

Number of devices

N+1, minimum of 3

N+2, minimum of 4

Parity

Distributed, single

Distributed, dual

Performance

Medium impact on write and rebuild

More impact on sequential write than RAID 5

Fault-tolerance

Failure of one component device

Failure of two component devices


Creating a RAID 6

The procedure in this section creates a RAID 6 device /dev/md0 with four devices: /dev/sda1, /dev/sdb1, /dev/sdc1, and /dev/sdd1. Make sure to modify the procedure to use your actual device nodes.

  1. Open a terminal console, then log in as the root user or equivalent.

  2. Create a RAID 6 device. At the command prompt, enter

    mdadm --create /dev/md0 --run --level=raid6 --chunk=128 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdc1 /dev/sdd1
    

    The default chunk size is 64 (KB).

  3. Create a file system on the RAID 6 device /dev/md0, such as a Reiser file system (reiserfs). For example, at the command prompt, enter

    mkfs.reiserfs /dev/md0
    

    Modify the command if you want to use a different file system.

  4. Edit the /etc/mdadm.conf file to add entries for the component devices and the RAID device /dev/md0.

  5. Edit the /etc/fstab file to add an entry for the RAID 6 device /dev/md0.

  6. Reboot the server.

    The RAID 6 device is mounted to /local.

  7. (Optional) Add a hot spare to service the RAID array. For example, at the command prompt enter:

    mdadm /dev/md0 -a /dev/sde1
    

SUSE® Linux Enterprise Server Storage Administration Guide 10