Installing Ubuntu Server on an unsupported raid controller

Sat, Oct 16, 2010

At work we recently purchased a new file server that has a brand new Areca 1880 series RAID controller. Which unfortunately is not supported by the arcmsr kernel module that ships with Ubuntu Server 10.04.1. So I looked around on the web for someone who’s blazed this trail before me and only found the occasional forum post that offered a few hints for a particular problem that someone ran into in this process. I never found a detailed walk through the entire process. Which lead to this blog post that I hope will help fill in the gaps for others.

Areca is a Linux friendly vendor and provides the kernel drivers and RAID utilities on their website as packages for RHEL and SUSE, as well as source code. Compiling and installing modules from source can be a bit intimidating at first. In my case I’ve had a lot of past experience with dealing with Areca controllers before their drivers were merged into the kernel main line back when I was running Gentoo on a couple of servers at a previous job. So this wasn’t a foreign concept or process to me. But it’s always nice to have some instructions to follow and Ubuntu makes this process more difficult by using a different kernel on the install media than it does once you have the system installed. So below is the procedure I used to get Ubuntu Server 10.04.1 installed on this RAID controller. While the details on file names, directories, etc may change I’m sure this process will work with any RAID controller where the source code for the driver is available.

Supplies

Like I mentioned earlier since the Ubuntu Server install uses the Ubuntu Desktop kernel, or include a build environment, in addition to the Ubuntu Server install cd you’ll also need a Desktop install cd for the same release and arch. This will be used to build a kernel driver that can be used for the Server installer kernel, 2.6.32-24-generic. So if you’re installing the 10.04 x86_64 server you’ll need the 10.04 x86_64 desktop cd. You’ll also need some removable media such as a floppy disk or USB thumbdrive with the required kernel module source code on it. We’ll also use this to load the compiled module as part of the installation process.

Prep

The Ubuntu Server install uses the desktop kernel and doesn’t include a build environment. So the first step is to get a kernel module ready to use for the install process. To do this boot up on the Desktop Installer into the live environment and open up a shell. And install the build-essential package by running sudo apt-get install build-essential . If you haven’t already unpacked the kernel module source code you can do this now to the /tmp directory. Now in the shell change to the directory containing the source code and run make all . If this completes without any errors you will have a kernel module built in the current directory. ls *.ko should list the kernel module. Copy the kernel module over to the removable media so that we can use it during installation. You should also already have the volume setup on the RAID controller that you wish to install Ubuntu to.

Install

Start the installation normally. At this point do not insert the removable disk. Eventually the installer will fail to detect any disks and give you a list of options. Select the last option, none of the above . It will then ask you if you would like the installer to attempt to find a driver on removable media. Select yes to this question. It’s looking for a deb package that contains the driver for the current kernel. Which we don’t have but this process loads all the necessary modules to access all your removable media. I found that it will fail faster if you don’t connect the removable media until after you do this step. After it fails to find a driver open up the 2nd console by pressing alt+f2 and insert and mount the removable media. If you’re using a floppy then to do that you would use mount /dev/fd0 /mnt , if you’re using a USB thumbdrive then mount /dev/sda1 /mnt . Now load the driver we built previously with the command insmod /mnt/arcmsr.ko . If you’re following this HowTo for another driver then just replace arcmsr.ko to the name of your module. Now go back to the installer by hitting alt+f1 and select back and tell the installer to detect the disk again. At this point it should detect the volumes on the RAID controller and potentially the USB thumbdrive. So make sure you select the volume on the RAID controller and proceed to install normally.

Post Install

Now we need to reboot the server but keep the server installation cd in. This time at the first menu select rescue broken system . We need to build the kernel module for the server kernel, update the initramfs, and correct the boot loader if you were using a usb thumbdrive for the driver.

Like the previous time this will eventually fail to detect the disk. Follow the same steps we used during installation to load the kernel module and proceed as normal. Once it detects the disk you’ll be asked to point it to the partition that contains the / for the broken system. Locate and select it. Then choose to execute a shell in root . Once you’re in that shell make sure that all the mount points are mounted. Especially the /boot mount point. Verify that it’s mounted by going into /boot and doing an ls. If the directory is empty then it’s not mounted. To mount this you need to run the command mount /dev/sda1 /boot . If you’re using a usb thumbdrive to load your driver then this is probably going to be mount /dev/sdb1 /boot . Running dmesg | tail should give let you know which block device the raid array is being assigned.

Now unpack or copy the source for the kernel module to /usr/src. Next we need to install build-essential. sudo apt-get install build-essential . Change directories to /usr/src/<module source>, replacing <module source> with the appropriate directory for your source code. Then run the command make KVER=2.6.32-24-server install . This is the version of the kernel that is on the 10.04.1 server install cd. So adjust this as necessary for your kernel version. This will build and install the kernel module.

Now we need to update the initramfs. This is used by the boot loader to boot strap the system during boot. So the RAID driver needs to be in the initramfs. The command to do this is update-initramfs -k all -c .

Now if you used a floppy drive at this point you can type exit and then choose reboot. Remove all removable media and the installation cd. The system should now boot normally. If you were using a usb thumbdrive then we need to fix the boot loader. To do this we type the command grub-install /dev/sdb . Replace sdb with the raid controller volume. Again dmesg | tail should show what designation it was given when you loaded the driver earlier. Now you can type exit and select reboot.

Kernel Updates

Once you reboot into your new install you’ll likely want to apply any updates by typing sudo apt-get update && sudo apt-get upgrade . Look through the list of packages and make note if it includes any kernel updates. If it does then you’ll need to run the following commands after the update but prior to rebooting. Replacing with the appropriate version.

cd /usr/src/<module source directory> make KVER=2.6.32-<new version>-server install update-initramfs -k 2.6.32-<new version>-server -c

This will build, install, and put the new module in the initramfs for the new kernel. You’ll need to do this any time you update the kernel until the Ubuntu kernel includes the driver you need.

If for some reason your server doesn’t reboot properly you always have the option to boot into the older kernel and debug and correct any issues.

Please let me know if this has helped you or if any corrections need to be made.

comments powered by Disqus