Managing RAID on Linux - Derek Vadala [41]
As of this writing, raidtools-1.0 has been released in a limited capacity. It can be found in Red Hat 8.0 and will likely become pervasive during the next few months. It fixes several minor bugs and can be used as a replacement for raidtools-0.90. Chapter 4 presents more information about raidtools-1.0 and some new utilities included with it.
raidtools-0.90
Most modern Linux distributions ship with the raidtools package. You can install them from your installation media or download them from your vendor. In a Red Hat CD directory, for example, issue the following command:
# rpm -ihv ./raidtools-0.90-20.i386.rpm
Debian users can use apt-get to install the raidtools:
# apt-get install raidtools2
Note that under Debian, raidtools2, NOT raidtools, provides the 0.90 raidtools package. Please be certain you have the proper package installed.
You can also download the source code and compile the package yourself. The most recent version is available at ftp://ftp.kernel.org/pub/daemons/raid/alpha. As of this writing, the most recent version is ftp://ftp.kernel.org/pub/linux/daemons/raid/alpha/raidtools-19990824-0.90.tar.gz. You might be aware that a seemingly newer version is available from http://people.redhat.com/mingo/raidtools/. There are several known problems with this version (raidtools-20010914), including its lack of a key management utility (raidsetfaulty). Use this version at your own risk. The raidtools package should compile without problems on any recent system, though it does require the popt libraries. There are currently no notable configuration options. Download and unpack the archive.
# cd /usr/src/raidtools-YYYYMMDD
# ./configure
# make install
Compilation will leave you with several executables. Of particular note are mkraid, used to create new arrays, and raidstart, used to activate arrays that have already been initialized with mkraid. Installation will copy binaries to /sbin and create symbolic links that invoke specific functions for each utility. raidstop, for example, is simply a symbolic link that causes raidstart to invoke a case switch based on the command line. Manual pages are also installed. Chapter 4 covers each command included with the raidtools package in detail.
At the time of this writing, version 1.0 of raidtools has just appeared in Red Hat Linux 8.0. Version 1.0 of raidtools corrects the issues associated with raidtools-20010914 and includes some major improvements, such as bug fixes and a couple of new utilities. lsraid will allow you to query arrays and member disks. It will even let you generate an /etc/raidtab file by querying a running array. raidreconf allows users to add (or remove) disks to a RAID-0 or RAID-5, usually without data loss. Although these utilities are somewhat new, I'll discuss them throughout this book, since they are particularly useful and will more than likely become widespread.
/etc/raidtab
/etc/raidtab is raidtools' primary configuration file. /etc/raidtab provides a function similar to /etc/fstab. It provides the kernel with a description of each software RAID, including its RAID level and a list of member disks. All RAID devices must have an entry in /etc/raidtab to be created or activated using raidtools.
Users create /etc/raidtab by hand, using any text editor. Once /etc/raidtab is created and contains configuration information about arrays, the mkraid command can be used to construct an array based on the parameters defined in /etc/raidtab. mkraid will complain if it cannot find a valid file at /etc/raidtab. This process is similar to creating the boot configuration file /etc/lilo.conf and consequently running /sbin/lilo to rebuild the boot block.
Here is a typical