Thursday, January 11, 2007

CentOS4 / RHEL4 Megaraid Drivers

I inherited an old Dell Poweredge 2400 as a test server from my boss, and I decided to put CentOS 4.4 on it. Apparently, Red Hat removed out-of-the-box support for old school Megaraid drivers. Dell would call these the PERC2/DC based systems. I Google'ed around and found a lot of forum posts regarding this, but there was always a discrepancy with the instructions that didn't fully get everything to work. Basically, since CentOS/RHEL 4.x does not autodetect these drivers any longer, you'd have to manually load the drivers before installing.

All forum posts point to Tom Sightler's great blog

that covered about 95% of what I needed. Below is a recap of the steps that I took which was adapted from Tom's great article. The other 5%-- however, since my Dell was a dual processor system, I needed to follow his steps and keep in mind that I needed to recompile drivers for a SMP system (I got the non-SMP drivers by compiling on my single processor workstation next to me.) If I had a dual processor system laying around, this would have made things easier. Still, even after successfully following Tom's steps and making it able to boot into the non-SMP kernel it wouldn't boot even after using the correct SMP drivers now with a new initrd.

So if you have a SMP system, I was able to find some drivers provided by Jackson Tech Support in New Jersey and actually load these drivers directly during the install and got everything up and running really fast.

Therefore, if you have an SMP system that's 32 bit Intel, this is the easy part (no drivers need to be compiled). Courtesy of Jackson Tech Support: his post or if that link is dead by now you can get it at my site.

Here's the simple steps for SMP now:

1) Copy those drivers onto a floppy on another machine, for example:

# dd if=megaraid.img of=/dev/fd0

2) Boot off the Linux install CD on the computer that you wish to install the drivers on, and type "linux dd" at the boot prompt.

3) Now when the system asks if you have any drivers, put in the floppy that you just copied the drivers to and let it load them.

NOTE: if the below steps don't work, you may first want to unload the incorrectly detected megaraid drivers by pressing ALT+F2 and going to the shell to do the following:

lsmod (see what drivers were detected)
rmmod megaraid_mbox
rmmod megaraid_mm
lsmod (verify they are removed)
insmod /mnt/floppy/megaraid.ko

Hit ALT+F2 to get back to the menu

4) There should be an option that allows you to choose drivers from a menu. These are the ones you want:

LSI MegaRAID for Legacy Dell PowerEdge Servers (megaraid)
Old Adaptec 28xx, 29xx, 39xx (aic7xxx_old)

5) Now when you're finished, go ahead and let anaconda start and your drives should now be detected!




Now if you have a non SMP system, I don't have packaged drivers for you, but you can follow these steps carefully to compile the single processor drivers on another Linux workstation, unload the incorrectly detected drivers, load the correct drivers, install Linux, then make a new initrd to ensure the boot loader chooses the right version of the Kernel that has your drivers loaded into it.

1) Follow Tom's steps to create the driver disk for single processor, and copy them to a floppy.

1) Boot off the Linux CD and choose "linux dd" at the prompt. When it asks for drivers, ALT+F2

2) Mount floppy w/ your driver disk
mkdir /mnt/floppy
mount /dev/fd0/ /mnt/floppy

3) lsmod and remove your megaraid drivers that it detects:
lsmod (see what drivers were detected)
rmmod megaraid_mbox
rmmod megaraid_mm
lsmod (verify they are removed)
insmod /mnt/floppy/megaraid.ko

(pause a little bit maybe and lsmod again to see if driver loaded)


4) ALT+F1 to go back and resume install via anaconda

5) When done, DO NOT REBOOT, but hit ALT+F2 again to goto the shell.

6) copy the megaraid driver to the drivers
cp /mnt/floppy/megaraid.ko /mnt/sysimage/lib/modules/2.6.9-42.EL/kernel/drivers/scsi

7) set /mnt/sysimage to the root

chroot /mnt/sysimage

8) edit modprobe, and make sure alias scsi_host adapater is alias scsi_hostadapter megaraid instead of something like megaraid_mbox

vi /etc/modprobe

9) switch to /boot and create a new initrd file

/sbin/mkinitrd initrd-2.6.11.EL.img.megaraid 2.6.9-11.EL

10) Overwrite old initrd with new:

cp initrd-2.6.9-11.EL.img.megaraid initrd-2.6.9-EL.img

11) ALT+F7 to switch back to installer and reboot

12) Make sure you choose the UP kernel instead of the default SMP kernel that Grub chooses upon bootup, or your system will not start.

Viola! Your RHEL4 based system can now boot up with the correct RAID drivers!

1 comment:

Unknown said...

Hi.

I really was impressive with your note, Emperor ;D
I have the same problem that you, thanks for your advice :D.
One think, yor link doesn't work "http://www.chandynasty.net/software/megaraid.zip":(
Could you tell me , where I may download megaraid.zip, please?
Best Regards!!!