These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/Software RAID Configuration

Classnotes | UNIX02 | RecentChanges | Preferences

The book mentions a package called 'raidtools', but the version in the book is no longer used. Do not confuse the raidtools discussed in the book with the raidtools2 mentioned here!

/etc/raidtab

/etc/raidtab is the core configuration file for your RAID system. It is very similar to /etc/fstab (see classnotes for day two) in that it defines the devices to be used for your filesystem, however its format is dramatically different. It is divided into sections defining specific RAID devices. Each section contains the specifications of that device. You can mix-and-match various RAID setups on one system using this file if you so desire.

Each RAID device section must contain an option specifying the RAID level, the number of devices in the array, and must specify the physical devices to be used. For example, a simple linear array with two devices might look something like this:

 raiddev /dev/md0
        raid-level      linear
        nr-raid-disks   2

        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1

Other options include specifying the number of spare disks (if any), data "chunk" size, and whether or not to use a persistent superblock (which is a small disk area allocated at the end of each RAID device, this helps the kernel to safely detect RAID devices even if disks have been moved between controllers.)

A more complicated raidtab file which includes a couple of devices using RAID-1 and a specific chunk-size looks like this:

 raiddev /dev/md0
        raid-level              1
        nr-raid-disks           2
        persistent-superblock   1
        chunk-size              64

        device                  /dev/hda5
        raid-disk               0
        device                  /dev/hde5
        raid-disk               1

 raiddev /dev/md1
        raid-level              1
        nr-raid-disks           2
        persistent-superblock   1
        chunk-size              64

        device                  /dev/hda6
        raid-disk               0
        device                  /dev/hde6
        raid-disk               1

For more information, see man raidtab.

raidtools2

Once you have configured your /etc/raidtab file, you must make your RAID devices and start them. The commands for manupulating your RAID devices are as follows:

mkraid

mkraid sets up a group of block devices into a RAID array. It can also be used to reinitialize a previously used RAID device or one which has been a part of a failing system. It does not create the file system on the device, for that you will still have to use the mkfs tools (see day two of the classnotes).

raidstart & raidstop

raidstart and raidstop are the tools for starting and stopping your RAID devices. The options for both are as follows:

  • -a, --all
Apply the command to all of the configurations specified in the config file.

  • -c, --configfile filename
Use filename as the configuration file (/etc/raidtab is used by default).

  • -h, --help
Displays a short usage message, then exits.

  • -V, --version
Displays a short version message, then exits.


Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 17, 2003 3:04 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.