HP Smart Array 410i as HBA
How to make a HP 410i into a HBA. ZFS loves HBA but HP is shy on the older devices. We will us a hack to get access to all settings in the raid card. I run a HP DL360 Gen 6 with Proxmox as my second NAS and for VM's needing many cores and fast storage, this is how I did it. #HBA #410 #HP
ZFS loves HBA but HP is shy on the older devices. We will us a 3d party hack to get access to all settings in the raid card. I run a HP DL360 Gen 6 with Proxmox as my second NAS and VM's needing many cores, this is how I did it. I have 4 x 900 G SAS drives as a fast ZFS2 array and a PCIe SSD for boot and systems, it also have a 4th partition used as a single disk ZFS for some HA VM's with replication.
This is not a guid it's a consept description
This is dangerous stuff to do - think about this warning for a while:
The HBA mode change will DESTROY your disks data!
The HBA mode change may DAMAGE yor hardware!
We are about to PATCH the Linux KERNEL!
It's possible to use RAID controllers to set up 4 raid0 disks, but some cards need HP's tools/licenses to do so. It will work, but there is some issues, and that's why everyone is saying don't do it.
You also need to know how to set up your BIOS and RAID bios.
Some issues to fix before getting started
Check your hardware and firmware before starting. See documentation or run Some commands like hwinfo --storage or use lspci, hardinfo, inxi etc.
Ask your self:
- Do I have the skills needed if it goes sideways
- Do I want to risk a 100 - 600€ server doing this
- Should I get an IT-mode/HBA card for 30 - 70€
My issues was
- I needed a fast SAS storage
- I needed the PCIe ports and couldn't add a HBA
- Old raid firmware version needed updating
- No HP tools for Proxmox or Debian
Start the upgrade process for P410i
Upgrading to 6.64.2 by downloading the firmware upgrade file from HPE's Redhat based Linux repository. Smart Component provides firmware for the following storage controllers: Smart Array P212, P410, P410i, P411, P711m, P712m, and P812
wget https://downloads.hpe.com/pub/softlib2/software1/sc-linux-fw-array/p332076214/v110820/hp-firmware-smartarray-14ef73e580-6.64-2.i386.rpm
To be able to use the .rpm on Debian we can use a tool called rpm2cpio
apt update && apt install rpm2cpio libc6-i386 lib32stdc++6
We also need, use apt update before installing
apt install hwinfo
apt install git dpkg-dev
# You might need
#apt install compat-libstdc++-33.i386 compat-libstdc++-33.x86_64 compat-libstdc++-296.i386
# These are needed but you might already have them
#apt install curl coreutils gcc kmod make patch
#systemctl reboot
# Adjust according to your version: uname -r
apt install pve-headers
# Get the kernel headers on Debian based systems
#apt dist-upgrade -y
#systemctl reboot
#apt install linux-headers-$(uname -r)
#apt upgrade linux-headers-$(uname -r)
Extract the binary
rpm2cpio hp-firmware-smartarray-14ef73e580-6.64-2.i386.rpm | cpio -idmv
Copy ccissflash binary to somewhere under your PATH (echo $PATH)
cd usr/lib/i386-linux-gnu/hp-firmware-smartarray-14ef73e580-6.64-2/
cp ccissflash /usr/local/bin
Run the upgrade binary
bash ccissflash or ./ccissflash
# Depending or your setup you might need to run bash hpsetup or ./hpsetup
Final step is to reboot and check everything for errors
Now we will set up the HP Smart Array HBA tool
If the firmware upgrade is successful, you should be able to reboot into your server in some minutes. And verify the version of your current running firmware.
If you have a P410(i) in HBA you need to patch your kernel.
apt install git dpkg-dev
apt install pve-headers
Now patch the kernel (5.18.83-1 as an example)
git clone https://github.com/im-0/hpsahba.git
cd hpsahba
# Create the man pages
apt install pandoc -y
make
Check if this folder is present on your system or adapt according to your kernel /lib/modules/5.15.83-1-pve/build
cd hpsahba/contrib/dkms
cp Makefile Makefile.orig
nano Makefile
# Do this change, here is my version of kernel:
#KDIR := /usr/lib/modules/$(KRELEASE)/build
KDIR := /lib/modules/5.15.85-1-pve/build
nano patch.sh
# Do this change to prevent errors
#VERSION=${1:-5.8}
VERSION=${1:-$(uname -r | grep -o "^[0-9]*[.][0-9]*")}
# Then run the patch
./patch.sh
Add a symlink /var/lib/dkms/hpsa-dkms/1.0/source → /usr/src/hpsa-dkms-1.0
dkms add ./
Add the hpsa-dkms to your kernel
dkms install --force hpsa-dkms/1.0
Start using it
modprobe -r hpsa
modprobe hpsa hpsa_use_nvram_hba_flag=1
echo "options hpsa hpsa_use_nvram_hba_flag=1" > /etc/modprobe.d/hpsa.conf
update-initramfs -u
Output example
update-initramfs: Generating /boot/initrd.img-5.15.85-1-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
Restart your node
init 6
After the re-boot you should see your disks as separate disks
lsblk
cd hpsahba/
./hpsahba -i /dev/sg0
Start using SMART on your disks - if possible
SMART is basically for ATA ans SATA devices. SCSI, SAS and NVMe drives do not always provide ATA/SATA-like SMART Attributes.
Check your HW by batcat /proc/scsi/scsi
smartctl --scan-open # Check for complient disks
smartctl -a /dev/sdg0 # For P410i you see no S.M.A.R.T.
smartctl -a -d cciss,0 /dev/sg0 # Gives some info from thr card
# If your disk is supported
smartctl -a /dev/sda # Reads the info from the disk
smartctl -s on /dev/sda # Start monitoring in Proxmox
Conclusion
To summarize a weeks work
Was it hard?
Lots of work finding the patches, hours of fact finding and recovery actions.
Did the install go smoothly?
Not at all. Endless reboots that takes for ever (servers are like that) and installing missing parts and doing compromises. And more fact finding and learning.
Did it go sideways?
Yes it did. Murphy's law, ones again.
I did install bat to read the logs, it helps.
apt update && apt install bat -y
# Add the use of my aliases and prompt in bash
nano .bashrc
...
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
# Add a alias to use bat as on all other systems
nano .bash_aliases
...
alias bat='batcat'
Was it wort the effort?
As a learning experience - absolutely YES
Counting the risk and time spent - definitely NO.
Will I do it again - NO for the next server I will get a HBA
Is it working?
Yes it's up and running with 4 SAS drives in a fast ZFS2 array.
References
How to setup servers is one of my post diskussing some aspects of things mentiond in this post [1]
To make a RAID controller to HBA we need tools. HP Smart Array HBA tool [2]
See Proxmox forums there is tons of info on anything and everything [3] and [4]
The Art of Server has a web shop for HBA's and an nice YouTube channel [5]
Smartmontools wiki has the answers to SMART questions [6]