Managing RAID on Linux - Derek Vadala [59]
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.
Deprecated Kernel Options
The following options are no longer shown in the configuration options for current kernel revisions. These features were originally experimental, but are now a standard part of the RAID subsystem. If you are using a kernel newer than 2.2.X, the options are enabled transparently as part of multiple devices support (CONFIG_BLK_DEV_MD). When using older kernels, you must explicitly enable these features if you require them.
Autodetect support (CONFIG_AUTODETECT_RAID)
CONFIG_AUTODETECT_RAID enables support for RAID autodetection during boot time. Traditionally, users have to execute commands from their init scripts in order to manually activate RAID devices. Autodetection allows the kernel to scan block devices for information about the arrays they belong to, and consequently to activate the devices while the system boots. This saves administrators from having to run the raidstart command in the system's startup files or at the command line. For RAID devices to be successfully autodetected, you must use fdisk or an equivalent partitioning program to set them to partition type Linux Raid Auto (0xFD). Some programs might simply list Linux RAID as the partition type. Please refer to the Partitioning with fdisk section of Chapter 3 for more information on this.
Boot support (CONFIG_MD_BOOT)
CONFIG_MD_BOOT is available with the RAID patches for older kernels and is standard in 2.4 and higher. Boot support allows arrays to be used at boot time, meaning that Linux can boot from a software RAID-1. That means a disk failure won't result in an unavailable system after a reboot. In addition to enabling this kernel parameter, you need to pass special flags to the boot loader. You can find details on using LILO to boot an array in Chapter 7.
md Block Special Files
The block special files /dev/md[0-255] provide access to software RAID devices. The md driver uses a major number of 9. On most systems, all of these files are created when the system is installed. If an md block special file is missing, you will get an error like: error opening /dev/md31: No such file or directory from mdadm or raidtools. You can create the file yourself using the mknod command. The following example creates the block special file used to access /dev/md31 with a umask of 0660:
# mknod -m 0660 /dev/md31 b 9 31
# chown root.disk /dev/md31
I specified b for block special file, 9 for the md major number, and 31 for the minor number. In general, the minor number and the number for the device name are the same. I also made certain that user and group ownership was set to root and disk, respectively. Repeat these commands for any device file you need to create manually.
Some distributions also come with the MAKEDEV program, usually found in /dev, although sometimes it is found as a symbolic link to /sbin/MAKEDEV. MAKEDEV can be used to create all the special files for any character or block device. It's more user-friendly than mknod, but MAKEDEV might not be available on all systems.
The following example uses MAKEDEV to create all the block special md files:
# /dev/MAKEDEV -v md
create md0 b 9 0 root:disk 660
create md1 b 9 1 root:disk 660
[...]
create md30 b 9 30 root:disk 660
create md31 b 9 31 root:disk 660
MAKEDEV will overwrite old device nodes. If you are working on a system on which the major or minor device numbers for your md devices have been altered, please be careful.
/proc and Software RAID
The /proc filesystem is a virtual filesystem that provides information about the system and the running kernel. Files located in /proc provide vital information about memory, devices,