Kernel Options

When you are configuring the kernel, the software RAID kernel features are all found under the Multiple devices driver support (RAID and LVM) subsection, regardless of the configuration method you use. Feel free to compile each level into the kernel statically or as a module.

[*] Multiple devices driver support (RAID and LVM)
<*>  RAID support
<M>   Linear (append) mode
<*>   RAID-0 (striping) mode
<M>   RAID-1 (mirroring) mode
<*>   RAID-4/RAID-5 mode
<M>   Multipath I/O support

With older versions of the kernel, it was necessary to enable support for Development and/or Incomplete Code/Drivers. But with version 2.4, you no longer need to enable that option because the RAID code is stable and included as part of the standard kernel.

Here is a list of kernel options for software RAID.

Multiple devices driver support (CONFIG_MD)

CONFIG_MD enables support for representing multiple physical block devices as a single logical device. CONFIG_MD must be enabled before RAID options will appear during kernel configuration. CONFIG_MD is also needed for LVM support.

RAID support (CONFIG_BLK_DEV_MD)

CONFIG_BLK_DEV_MD activates the base RAID driver, which contains code that is shared among all software RAID levels. Individual RAID levels must be selected after CONFIG_BLK_DEV_MD is enabled. RAID levels will not appear during kernel configuration unless this option is selected first.

Linear (append) mode (CONFIG_MD_LINEAR)

CONFIG_MD_LINEAR allows multiple drives to be concatenated end-to-end so that when a single member disk becomes full, data will be written to the next disk until all disks are full.

RAID-0 (striping) mode (CONFIG_MD_RAID0)

CONFIG_MD_RAID0 enables support for RAID-0 (striping), which allows multiple disks to be arranged so they are evenly filled, one chunk at a time. If disks of differing sizes are used, data is evenly distributed across all disks until one disk becomes full. The data then continues to be evenly distributed across remaining disks, although you won’t experience the same level of performance. Thus, if three 4 GB drives and a single 6 GB drive are used, data is evenly distributed across all disks until the 4 GB drives (16 GB of data) are full. At that point, data is written only to the remaining 6 GB disk.

RAID-1 (mirroring) mode (CONFIG_MD_RAID1)

CONFIG_MD_RAID1 activates support for disk mirroring. Each disk in a RAID-1 contains exactly the same data. There is an additional write operation for each disk, making write performance with RAID-1 slower than with other RAID levels. (Note that write performance is a function of the number of member disks.) However, read performance is improved because requests are distributed across each disk in the mirror. If disks used in a RAID-1 are not the same size, each disk is truncated to the size of the smallest disk.

RAID-4/RAID-5 mode (CONFIG_MD_RAID5)

CONFIG_MD_RAID5 enables RAID-4/RAID-5 mode and activates support for either of these parity RAID levels. The choice between the two is made in an /etc/raidtab configuration file or on the command line with mdadm, and not in the kernel configuration itself. While RAID-4 stores parity information on a single disk, RAID-5 provides redundancy by spreading parity information across each member disk. That means RAID-5 performs better than RAID-4 because operations are distributed across all disks, instead of all but one disk. Like RAID-1, devices used in a RAID-4 or RAID-5 are truncated to the size of the smallest disk.

Multipath I/O support (CONFIG_MD_MULTIPATH)

CONFIG_MD_MULTIPATH enables support for multipath, which allows Linux to address a single disk using multiple controller paths. Disks that support multipath operation are connected to more than one I/O channel. If one controller or channel becomes unavailable, the operating system is still able to communicate with the disk. Multipath is very new feature and is not covered in this book.

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.