There is one precondition to the development of any RAID configuration that is absolutely required, and a second of sufficient significance that it should be regarded as virtually required. The first, of course, is that support for the level of RAID you are intending to use must be enabled in the kernel. There are two generations of software RAID, one generally used with pre 2.3 kernels, and one with 2.3, 2.4, and patched 2.0 and 2.2 kernels. I am going to focus on the second generation, sometimes called "new-style". As the 2.4.13 kernel is required for mosix anyway, the kernel configuration will be seamless. The specific options that must be enabled are shown in a screen shot in the kernel configuration section, specifically the eighth screen. The second prerequsite is that the partitions used in a raid array must be of type "fd" (linux raid autosense) if it is desired to mount the drive pack to a mount point in the /etc/fstab file, thus making it available at system start. It is also possible to mount the root partition as a drive pack and boot to it as a RAID drive, but personally I regard that as offering relatively small benefit, especially for a server. Neverteheless, if you are interested in pursuing that further, you can find more information here.
I should mention at this point that there is a new Ralphzilla-raider. A workstation here must have taken a power hit, becuase it developed problems with the on-board video adapter. I replaced it with the machine that had been Ralphzilla-raider, and as local video output is not all that relevant for a machine within the cluster I have configured that workstation as the replacement for ralphzilla-raider. In the process, however, I discovered that the pci interface had also been damaged, with the result that the scsi adapter I had used previously would not work on this machine. The on-board ide interface works fine, however, so I've configured the machine around three ide drives. While I would much prefer scsi, as long as the machine provides a stable baseline against which I can evaluate benchmarks under different configurations it presents a satisfactory solution. It is not likely that this machine will play the role of the database server / data storage machine in the cluster once I start using the cluster in a production environment, but it is quite possible that it will be used as a non-dedicated cluster workstation.
Regardless, the necessity of configuring another machine to play the role has provided the silver lining of an opportunity to step through the RAID configuration in the same time frame as its creation. The partition structure of the three ide drives is as follows (drive hda is 3 Gb., hdb is 813 Mb., and hdc is 2 Gb.):
| PARTITION | SIZE | TYPE |
| .. | ... | ... |
| ... | HDA | ... |
| hda1 | 1251 Mb. | ext2fs (type 82) |
| hda2 | 813 Mb. | Linux Raid Autosense (type "fd") |
| hda3 | 99 Mb. | Swap (type 83) |
| hda4 | 1073 Mb. | Linux Raid Autosense (type "fd") |
| .. | ... | ... |
| .. | HDB | .. |
| hdb1 | 813 Mb. | Linux Raid Autosense (type "fd") |
| .. | ... | ... |
| .. | HDC | ... |
| hdc1 | 150 Mb. | Swap (type 83) |
| hdc2 | 813 Mb. | Linux Raid Autosense (type "fd") |
| hdc3 | 1148 Mb. | Linux Raid Autosense (type "fd") |
If the preconditions discussed above are met the first step in setting up a RAID configuration is to create the file, /etc/raidtab, that specifies the configuration. (Actually, this step and the next are pretty much interchangeable. I discuss them in this order because the narrative will string together a little bit better this way. Trust me, you'll see.) In software-only RAID, wherther in linux, Windows NT and its descendants, or some other operating system, you combine partitions on seperate disks to allow them to function as a single drive. The different types of RAID reflect the different types of ends that can be achieved by combining the partitions in different ways. Rather than taking time here to describe them, I'll refer you to this page from the on-line documentation for Red Hat Linux. I am limiting my discussion to RAID 0 because it fits into the surplus machinery framework so well, as is evidenced by the configuration of the replacement Ralphzilla-raider.
A quick look at the way the partitions are configured in the above table will probably clue you right in on the way I have configured the setup. Partitions hda2, hdb1, and hdc2 are combined into one drive pack and partitions hda4 and hdc3 into a second. Note that these two partitions are not exactly the same size - in such a circumstance the space available for the drive pack will be a multiple of the smallest partition, in this case 2146 Mb (2 x 1073 Mb., the size of partiton hda4). Recognize as well that if you are using drives of different sizes and geometries you are going to have to do some careful calculation if you want to minimize the amount of space that can be used in a pack. To an extent, however, you should recognize that some loss is inevitable, and spending much time tgrying to avoid losing 50 Mb. on a 6 Gb. system just doesn't make much sense. I paid virtually no attention to that as I configured this machine, because it is there explicitly to support benchmarking and almost certainly will not be configured in this fashion if the machine is included in a production cluster. You should also recognize that if you spend half an hour trying to wring 30 or 40 Mb. out of a configuration when you can buy a drive 100 times as large for $25 USD, you had best be able to rationalize that on the basis of the experience you gain. The /etc/raidtab file that reflects this configuration is included as an example here.
Before you can actually create the drive packs, however, you must install the tools to do so. For the "new style" raid we are using, these tools are included in the raidtools2 package, so issue the command "apt-get install raidtools2". The installation script will create the multi-disk devices (/dev/md0, etc.) and the tools required to create the pack. If you've forhgotten to upgrade your kernel, you'll be made aware of it at this point, because the tools will not install and will let you know about it. Once the tools are installed you can create the packs with the mkraid command. To follow our example, the commands are "mkraid /dev/md0" and "mkraid /dev/md1".
Once the packs are created you must create the file systems for each. To create an ext2 file system on the /dev/md0 device, for example, the command would be "mke2fs /dev/md0". You'll have to create a mount point before you can access the drive you've created, to do that just make sure you are logged in as root, then create a directory. On the current file system of Ralphzilla-raider, the three partition drive pack is mounted at the mount point /data, so I went to the root directory and issued "mkdir /data". I could then mount the drive with the command "mount /dev/md0 /data", or include it in /etc/fstab to make it available at boot by adding the following line to /etc/fstab: "/dev/md0 /data /ext2 /defaults 0 1". Recognize that if I had desired to also mount /dev/md1 to make it available under that mount point I could have, and may yet, created a structure that included something like /data/1 and /data/2 and mounted /dev/md0 to /data/1 and /dev/md1 to /data/2.