Gentoo Wiki


This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related



The LSI 8208ELP (at least the one I've got (warning: page is in Hebrew :)), is a SOFTWARE based PCI-Express (x4) RAID Controller; Although the RAID array can be created at the BIOS level (it has its own BIOS) and although it CAN boot from RAID5, the actual RAID operation that is being done during normal operation is done by an Operating System driver, and not a dedicated CPU on the card, for the best of my understanding from conversation with LSI people; This is something I did not know before I bought the card, because I believed that every RAID5 controller must be a Hardware-based one. Not true... I hope this helps someone (I would probably skip this purchase had I known...)

Why writing a HOWTO? What's special about this hardware?

Because this controller does not have any kind of support in the Linux kernel. There are tips on the Internet that includes patching certain files in the kernel, making it think it's a similar controller, which works (I tried...) - but identifies all the disks in the controller as JBOD, and not as a one logical array.

Do they actually sell a RAID5 Controller that doesn't support Linux?

Well, depends on how you look at it. Since (and this is my guess) all the work of the RAID is done at the driver level, they probably don't want anyone to steal it, which is why they don't distribute the source code of the driver, which is also probably the reason why it didn't get integrated into the Linux Kernel... instead, they're providing binary packages only for RHEL and SLES, and, after talking with them (thanks Sreenivas Bagalkote from LSI), I found out that there's a SHIM package to support the controller in other Linuxes as well. A SHIM package is an opensource code which in turn is linked with a binary (the proprietary part), and becomes a module that can be compiled against any kernel (well, in theory. Read on...).

Before you start...

Go into the controller BIOS during boot and set up the arrays that you want.

The Challenges

Get the controller running on an existing system, to install a Gentoo system on in a chroot

This is rather easy. Download the package that contains the SHIM package. Make sure that your running kernel is not above 2.6.19. Why? Because the Kernel source changed, and some stuff that is included with the SHIM package, as of writing this document (December 16th, 2007), will no longer pass compilation with newer sources.

Uncompressing the Shim Package

Code: Create a working directory and uncompress the Shim package into it
$ mkdir lsi
$ cd lsi
$ unzip ../ # If you don't have the unzip command, run "emerge unzip" first
$ unzip # Two directories will be created: open_source and library

Compiling the Shim Package

Code: Compile the Shim Package
$ cd library/rhel5-64 # or rhel5-32 if you have a 32bit kernel
$ make -C /usr/src/linux M=$PWD # Make sure that /usr/src/linux is a symlink to the sources of the currently running kernel

Loading the module we just compiled

That's it, if nothing is wrong, a file called megasr.ko would be created in your working directory.

Code: Loading the megasr module
$ insmod megasr.ko

Install Gentoo on your newly recognized Hardware

OK, not really a challenge ;) But now you would do it on the newly generated SCSI drive(s). If you want to see all your drives, you could use:

Code: Listing last information about SCSI drives from the kernel output
$ dmesg | grep sd

This guide assumes that you'll be using a kernel not newer than 2.6.19 on your new installation (due to the limitation mentioned above), and that you'll use Genkernel to compile your kernel (adding options to genkernel, like --lvm or --menuconfig is OK; This guide relies on Genkernel because of the excellent initramfs it will make for us, and save us time. So please go the genkernel route if you want to keep reading this guide.

After you completed the install of Gentoo...

Make sure that you installed your bootloader, and that your kernel and initramfs has been placed in /boot. Also, make sure to add "doscsi" to the kernel options in your bootloader (we rely on that in this guide), and other options that are mandatory for your environment (for example, if you use LVM like I did, you need to also add "dolvm").

To the fun part: Embedding the megasr module inside Genkernel's initramfs

First, re-compile the megasr module inside the chroot with the new sources and kernel configuration in your chroot. Follow the exact same steps as above, just don't load the module (don't do "insmod megasr.ko"). For the sake of the example, I am assuming that you unarchived and compiled the package from /root, so you have /root/open_source and /root/library.

So here is what you do:

Embedding a new module into an existing Genkernel initramfs

Code: Opening the initramfs cpio archive
mkdir myinitramfs && cd myinitramfs
cp /boot/initramfs* .
mv initramfs* initramfs.gz
gunzip initramfs.gz
cpio -i < initramfs
rm initramfs.gz
Code: Embedding our self-compiled module into the initramfs directory structure

cp /root/library/rhel5-64/megasr.ko lib/modules/*/kernel/drivers/scsi

Telling the Genkernel initscripts to try to load our self-compiled module

Remember I mentioned that you should add "doscsi" to the kernel options? This is why. Edit the file etc/modules/scsi:

Code: Editing etc/modules/scsi

nano -w etc/modules/scsi

Now add "megasr" in the first line (push all the other lines down, and save and exit (ctrl+x - y - enter)

Now let's pack our custom version of initramfs

Code: Packing our custom made initramfs, while overwriting the one made by genkernel...
find . | cpio -H newc -o | gzip -9 > /boot/initramfs*

Now you should be able to reboot your machine and your kernel is supposed to be able to access your RAID storage Controller. Good Luck!

For questions/clarifications about this Guide, please use the Talk Page.

Retrieved from ""

Last modified: Sat, 30 Aug 2008 22:55:00 +0000 Hits: 4,110