High Availability with RAID

As storage needs increase, it sometimes becomes necessary to put additional drives with larger capacities online. Yet ironically, the law of probability dictates that as the number of storage devices increases, so too does the likelihood of a device failure. Therefore, a system with a single hard drive is only 25% as likely to suffer a hardware failure as a system with four drives. [ Well, theoretically speaking, anyway :-) ]

Fortunately, such failures can be handled gracefully, and more importantly without downtime, using a technique called “Redundant Array of Inexpensive Disks” (RAID) which uses one of several methods of distributing data over multiple disks. This redundancy allows for automatic recovery of data should a device fail.

This section will describe the installation, configuration, and setup of a RAID disk array using the Mylex AcceleRAID DAC960 controller. I have been very impressed with not only the performance and reliability of the controller itself, but also with the technical support I've gotten from Mylex -- they are very Linux-friendly! (However, there are a wide variety of hardware RAID solutions for Linux, and RAID can be implemented in software by the Linux kernel itself.) The type of RAID implementation that is most useful is probably RAID level 5.

The first step in getting the RAID controller usable under Linux is to build a custom kernel with driver support for the hardware. The driver for the Mylex DAC960 can be downloaded from the Dandelion Digital Linux page at http://www.dandelion.com/Linux/DAC960-2.0.tar.gz.

The final step in getting your RAID array usable under Linux is to use the ``fdisk'' utility to create valid partitions. This is done in exactly the same manner as you would use on an IDE or regular SCSI drive. See the section called Partitionner votre(vos) disque(s) dur(s) in Chapter 4 for details on how to set up partition information.

Note

Note: The DAC960 driver supports a maximum of 7 partitions per logical drive. If you need to define more, you will need to define multiple logical drives in the RAID configuration utility (press <Alt>-<R> at system boot time to enter the setup utility).

Once you are able to see your RAID array, you should initialize any swap areas and file systems you wish to define. The following is an example of initializing a swap area on the third partition of the second drive, as well as an ext2-formatted file system on the first partition of the first drive:

/sbin/mkswap -c /dev/rd/c0d1p3
/sbin/swapon /dev/rd/c0d1p3
/sbin/mkfs.ext2 -c /dev/rd/c0d0p1

Note

Note: The ``-c'' option in the above ``mkswap'' and ``mkfs.ext2'' commands enable bad-block checking as the appropriate swap/file systems are created. This adds substantially to the time it takes to complete the process, but it is probably a very good idea to perform such checks.

For any new swap areas you have defined, you should make an entry in the ``/etc/fstab'' file to ensure the swap area is actually used from subsequent bootups. As per the above example, the following line should be added:

/dev/rd/c0d1p3  swap       swap  defaults   0 0

Finally, once your file systems have been initialized, you can create mount points there and move your large file systems onto the array as you desire. It is probably a good idea to test the array for a few days before using it in a production environment.

For further information on the Mylex AcceleRAID controller, visit the Mylex web site at http://www.mylex.com/ as well as the Dandelion Digital DAC960 driver page at http://www.dandelion.com/Linux/DAC960.html. For further information on RAID in general (including both software- as well as hardware-based solutions), see the Linux High Availability web site at http://linas.org/linux/raid.html.