Monday, August 20, 2012

Debian Squeeze Installation on HP Gen8 Servers

Update: Thanks to an anonymous commenter I can confirm that with the release of Debian Squeeze 6.0.7, released 2013-02-27, the Debian Installer package uses a back ported version of hpsa to detect controllers not supported by cciss.  The remainder of this post is left for historical reference.

TL;DR Build the hpsa Driver From Source and Deploy in D-I

Symptom:
Can't Detect CD-ROM and/or RAID Disks on HP Gen8 Hardware

My team was attempting to install Debian GNU/Linux 6.0.5 (squeeze) on a brand new HP DL360 Gen8 server with a P420 RAID controller and much to our chagrin it couldn't even detect the CD-ROM drive let alone the RAID sets.

Solution:
Build hpsa.ko From Source

Point your favorite browser over here and grab the 3.0.0-8 (or newer YMMV) release and make sure you have bzip2 installed with ye olde apt-get install bzip2.  You'll need that for the next step.  I've assumed you downloaded the driver into the ~/Downloads directory.

I prepare the directory:
 $ mkdir ~/src
 $ cd ~/src
 $ tar -xjf ~/Downloads/hpsa-3.0.0-8.tar.bz2
 $ cd hpsa/drivers/scsi

To build the hpsa driver you need to edit the hpsa_kernel_compat.h file and remove the comment block corresponding to the OS you wish to build the driver for.  There's just one little problem; there's no block for Debian GNU/Linux.  Fear NOT!  The kernel that ships with Debian 6 is a 2.6.32 kernel.  This is the same basic kernel as shipped with SUSE Linux Enterprise Server 11 SP1.  So just uncomment the following line:
 #define SLES11sp1

If you've got gcc installed and the linux-headers package you can just save the hpsa_kernel_compat.h file and type make.  This will build the hpsa.ko file that you so desperately need.  Now copy that file onto some removable media and go attach it to your Gen8 server.

Installing hpsa.ko During Installation

Now go ahead and boot any of the Debian 6 installation media(netinst.iso, businesscard.iso, cd1.iso or dvd1.iso).  Once d-i is loaded you will be greeted by the message that the CD-ROM device couldn't be detected.  This is where the new driver comes into play.

Switch over to the second console with ALT+F2, press enter and now insert your removable media if you haven't already.  I'm going to use the device name of usbdevice in place of the likely /dev/sda1 or /dev/sdb1 that your removable disk will be recognized as.

Perform the following incantation:

 $ mkdir /mnt/usb
 $ mount /dev/usbdevice /mnt/usb
 $ cp /mnt/usb/hpsa.ko /lib/modules/$(uname -r)/kernel/drivers/scsi
 $ depmod -a
 $ modprobe hpsa

To confirm you see the disks, simply use the dmesg command.  You should now have access to all the devices connected to your HP Gen8 server.  This has only been tested with the P420 controller.  It's possible that your Gen8 may have a different controller.  If so these instructions are worth a shot if you need to access the controller using the hpsa driver.


Switch back over to the d-i terminal, ALT+F1, and detect the CD-ROM drive again.  If all went well you can begin installing Debian GNU/Linux 6.0.X (squeeze) on your shiny new server.

Happy Hacking!

18 comments:

Justin F. said...

Nice write-up Zac. Of course, after installing, the system will not be able to see the newly imaged disks. This is because the hpsa.ko driver that was used to perform the installation was not used in the newly installed system.

To get around this, one needs to boot into recovery mode and mount the external storage and do the copy and modprobe again, as documented above.

You will then need to mount the real "root" file system somewhere like /mnt/system, then mount the real "boot" file system under /mnt/system/boot. I mounted all the other file systems while I was at at to make sure I had all the tools I needed (i.e. "usr"), but this really depends on how you set up your partitions.

Next, copy the hpsa.ko file to the real file system under /mnt/system/lib/modules/$(uname -r)/kernel/drivers/scsi.

Then chroot to /mnt/system and run "dpkg-reconfigure linux-image-$(uname -r)".

This will recreate your initramfs and auto update GRUB to boot with it. And now that it has been created using the new hpsa module your system will happily boot with your new disks.

Finally, depending on your DVD configuration, you may also need to update the BIOS to use "SATA AHCI Support", rather than SATA Legacy Support. Our DVD was not visible to the running system until this was done.

Unknown said...

I am getting the error below when I type "depmod -a" uname -r is 2.6.32-5-486

Fatal: Error inserting hpsa (/lib/modules/$(uname -r)/kernel/drivers/scsi/hpsa.ko): invalid module format.

Zac Slade said...

How did you build the hpsa.ko driver?

Usually when you get that error it means that the hpsa.ko was built against a different kernel version or possibly built against a different architecture.

Make sure you are using a 2.6.32-5-486 when you build the hpsa driver.

Unknown said...

I recompiled it using the 486 kernel and I was able to do "modprobe hpsa" without any errors. Now the problem is that we still can no see the CD or HDD's

Elijah Jericho said...

I have tried this but modprobe hpsa
shows nothing ?

Anonymous said...

Same thing here, built against correct kernel and no errors on depmod or modprobe but I do not see and disks. I do have a smartarray p420i however.

Zac Slade said...

I tested this process with a P420i as well.

After the modprobe do you see the hpsa driver listed in the output of lsmod?

Are there any new entries in the dmesg output after modprobing the hpsa driver?

Zac Slade said...

Elija and Anonymous:

Are you having the problem in the d-i environment or are you able to complete the installation?

Elijah Jericho said...

I cant complete the install
dmesg reports

41.206645 hpsa 0000:02:00.0: unrecognized board ID: 0x3554103c, ignoring.

Zac Slade said...

See if this works for you:
modprobe hpsa hpsa_allow_any=1

I'm trying to find that board ID to see when the upstream kernel version of hpsa started supporting it. The 3.0.0 code dump on the cciss.sourceforge.net site just doesn't have that product id added to the list yet, but the driver might just work anyway.

Elijah Jericho said...

I managed to get it to work

like this

switch to another konsole during the install

# modprobe -r hpsa
# modprobe hpsa hpsa_allow_any=1

then re-detect the disks

after the install I needed to boot from a recovery disk and add modprobe hpsa hpsa_allow_any=1 to grub.conf

cpqacuxe cant see the disks though

Zac Slade said...

Great job Elijah! I think the issue is that you need to use the hpacucli not the cqpacuxe to configure the RAID arrays from Linux.

It's available for Debian in the same place just add the following line to your sources.list file and install the hpacucli package:
http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/Debian/ stable/current non-free

Jukka Inkeri said...

I done some retry steps.
Debian 7 beta has builtin support. It is easy.
But if you like to use Debian 6.0.6, then you need new hpsa.ko and some steps.

I have put all my steps in a file and also compiled hpsa.ko for adm64.

My readme + hpsa.ko


Zac Slade said...

Thank you Jukka! That's really nice of you.

Also as stated by Jukka none of these steps need to be done for Debian 7 (wheezy) due to the updated kernel which comes with a much newer version of the hpsa driver and works out of the box.

Anonymous said...

Debian Squeeze 6.0.7, released 2013-02-27, contains backported updates to the hpsa driver and supports the Gen8 SmartArray controller without modification.

http://www.debian.org/News/2013/20130223

Marius SAH said...

Hi Zac,
I follow your tutorial, but the disks aren't detected.
I try to install Debian 5.8.0 on servers HP ProLiant DL380 Gen9 High Performance - 2U - 2 voies - 2 x Xeon E5-2690v3 12c 2.6 GHz - RAM 32 Go - SAS - 2 x HP 300GB 6G SAS 10K 2.5- DVD RW - G200eH2 - GigE, 10 GigE –
Below output i get from dmesg :

[ 4317.097025] Physical aborts supported: yes
[ 4317.097027] Logical aborts supported: no
[ 4317.097028] HP SSD Smart Path aborts supported: yes
[ 4317.109693] hpsa 0000:03:00.0: hpsa0: <0x3239> at IRQ 116 using DAC
[ 4317.125555] bft2_offset = 0x8f4
[ 4317.141711] scsi9 : hpsa
[ 4317.149047] hpsa 0000:03:00.0: added scsi 9:3:0:0: RAID HP P440ar controller SSDSmartPathCap- En- Exp=1 qd=1024
[ 4317.149053] hpsa 0000:03:00.0: added scsi 9:0:0:0: Direct-Access HP EG0300JFCKA PHYS DRV SSDSmartPathCap- En- Exp=0 qd=58
[ 4317.149058] hpsa 0000:03:00.0: added scsi 9:0:1:0: Direct-Access HP EG0300JFCKA PHYS DRV SSDSmartPathCap- En- Exp=0 qd=58
[ 4317.149669] scsi 9:0:0:0: RAID HP P440ar 3.56 PQ: 0 ANSI: 5
[ 4317.150005] scsi 9:0:0:0: Attached scsi generic sg1 type 12

Thank your help to solve these issues

erection pills online viagra said...

What's up, its good paragraph concerning media print, we all be familiar with media is a enormous source of data.

Ava Luke said...

HP DL380 Gen9 Rack Server in UAE, Proliant 2U Rack Server in UAE, Rack Server in UAE
https://gccgamers.com/hp-dl380.html
HP DL380 Gen9 Rack Server in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
1634539500307-9