Software RAID in OpenBSD 3.9: Configuring the RAID

| | Comments (0) | TrackBacks (0)
This is the second part of the instructions for setting up a software RAID in OpenBSD. If you haven't enabled RAID in your kernel (and recompiled it) yet, please read the previous post before proceeding.

First, we need to create the raid configuration file, /etc/raid0.conf (that's a zero, not a vowel). This file is broken into four parts: the array definition, the member disks, the array configuration, and I/O limits.

Here is an example file that configures three SCSI disks into RAID 5 with no spare:

START array
1 3 0

START disks
/dev/sd1a
/dev/sd2a
/dev/sd3a

START layout
128 1 1 5

START queue
fifo 100

Next, we need to create disk labels on each of the component disks, in this case sd1, sd2, and sd3:
# disklabel -E sd1

This will bring up the disklabel editor you used when initially installing OpenBSD. Erase any existing disk labels on your raid component drives and add a (command a a). Use the default values for offset and size (they will use the entire disk), but for filesystem, type RAID. Do this for each of the disks in the set.

Now, we need to apply our configuration file to the RAIDFrame device:

# raidctl -C /etc/raid0.conf raid0


Next, initialize each of the component drives:

# raidctl -I 20061015 raid0

The numbers in the middle can be anything -- they're an identifying code for the raid set. Just make sure to use unique identifiers if you have more than one raid set. We're almost there.

Now we need to initialize the set as a whole. This will write the initial parity across the drives:

# raidctl -iv raid0 &


The ampersand at the end sets it up to run as a background process, so if your terminal connection is broken, it will still complete. This is important because many ssh clients are set to time out with inactivity, and this will take a while. In fact, it will probably take long enough for you to grab a cup of coffee. When it's complete, you basically have a raid drive installed and just need to give it a label and mount it. Treat the raid as any other disk from here on out.

The remaining steps are label it, format it, and mount it. You can create a single partition or divide it up as you see fit using the same disklabel tool:

# disklabel -E raid0

You will need to do this to format each partition you created in disklabel. Just change the letter at the end of the command to address each partition:

# newfs /dev/rraid0a

It can now be mounted however/wherever you'd like, including in /etc/fstab for mounting at boot time.

0 TrackBacks

Listed below are links to blogs that reference this entry: Software RAID in OpenBSD 3.9: Configuring the RAID.

TrackBack URL for this entry: http://snackfin.com/mt/mt-tb.cgi/4

Leave a comment

Tag Cloud

Powered by Movable Type 4.12