Software RAID in OpenBSD 3.9: Updating the Kernel

| | Comments (0) | TrackBacks (0)
OpenBSD is an elegantly simple operating system to administer; most software can be installed by typing a few choice keywords. Compiling binaries is generally frowned upon (as most ports are available pre-compiled as packages already) and very few system administrators will find the need to run a customized kernel. In this regard, configuring software RAID in OpenBSD could be considered complex, as there are two parts to it -- customizing the kernel and configuring the RAID itself.

This post will detail how to enable RAID in the kernel. I will follow up with how to configure the array tomorrow. If you haven't downloaded the source tree, you should do it now. I would recommend getting the patch branch from CVS (instructions are available here on the OpenBSD site).

To recompile the kernel, we will be modiying the kernel configuration file (if you are using an architecture other than i386, you will need to substitute the appropriate name):
/usr/src/sys/arch/i386/conf/GENERIC

First, I would back it up.

# cp /usr/src/sys/arch/i386/conf/GENERIC \
> /usr/src/sys/arch/i386/conf/GENERIC.old


Add these lines with an appropriate comment (such as your name and the data and purpose of the change):

option RAID_AUTOCONFIG
pseudo-device raid 4


Save your changes and run config:

# cd /usr/src/sys/arch/i386/conf/
# config GENERIC


Now we're ready to complile the new kernel. Move into the compilation directory and compile it:

# cd /usr/src/sys/arch/i386/compile/GENERIC
# make clean
# make depend
# make


Finally, backup your old kernel and activate the new one by installing it at the root level:

# cp /bsd /bsd.old
# install -o root -g wheel -m 644 bsd /

The flags set the owner (-o) group (-g) and permissions of the new binary. Finally, you need to rebuild the userland:

# rm -rf /usr/obj/*
# cd /usr/src
# make obj
# cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
# cd /usr/src
# make build

This post draws heavily from the OpenBSD FAQ. You can find answers to all sorts of questions there.

0 TrackBacks

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

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

Leave a comment

Tag Cloud

Powered by Movable Type 4.12