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_MDenables support for representing multiple physical block devices as a single logical device.
CONFIG_MDmust be enabled before RAID options will appear during kernel configuration.
CONFIG_MDis also needed for LVM support.
- RAID support
CONFIG_BLK_DEV_MDactivates 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_MDis enabled. RAID levels will not appear during kernel configuration unless this option is selected first.
- Linear (append) mode
CONFIG_MD_LINEARallows 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_RAID0enables 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_RAID1activates 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_RAID5enables 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_MULTIPATHenables 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.