Flashing LSI9240 Series Cards to IT Mode
Hello friends, I’ve been posting a lot I’ve come out of hiding to chronicle some work I’m doing on setting up a ZFS based NAS, because dat error correction.
My ZFS distro of choice for this adventure is FreeNAS, since it is well supported and has a plethora of plugins to support all the things I want to do. I’ll go into hardware another time, but suffice to say, the less between ZFS and your drives the better. ZFS uses error checking at every stage in the process of storing your data. If errors are abstracted or hidden by hardware between it and the drives, bad things happen.
In the DIY NAS community most people advocate the LSI series of host-bus adapters (HBAs) which come in an exciting variety of flavours. Most notably the IBM ServeRAID M1015, which can be cheaply found on eBay and reflashed to an HBA (or IT mode).
Now there are a lot of caveats with flashing these cards but I am going to document the basics of my setup. If you need more information ask your friend to google it for you.
- Note the SAS address of your card, usually it is printed on a white sticker on the back, and is a 16 digit hex address, for IBM cards this will start with 500605
- Make a bootable USB drive
- Make it both UEFI and DOS bootable, using the DR-DOS image
- Download an EFI shell, rename the file to shellx64.efi and place it in the root of the USB drive
- Create a folder in the root named SAS2008
- Download the LSI utilities and unzip them all in the SAS2008 folder
- Go to the LSI9211 downloads page and download the following files under firmware:
- Installer for UEFI
- Installer for MSDOS and Windows
- Firmware package IR and IT
- From these copy the following files to the SAS2008 folder:
- \sas2flash_dos_rel\sas2flsh.exe
- \Firmware\HBA_9211_8i_IT\2118it.bin
- \sas2flash_efi_ebc_rel\sas2flash.efi
- Now boot your computer from the USB drive, selecting the non-EFI mode first
- How you do this will depend on your exact motherboard
- Navigate to the SAS2008 directory by using the
cd
command - First we have to clear the firmware by running
megarec.exe -writesbr 0 sbrempty.bin
- Now we clear the flash
megarec.exe -cleanflash 0
- Reboot your computer and select EFI boot this time
1. Sometimes this may not work for the following reasons:
- Mysteries
- You have secureboot enabled
- Or you have to use the “boot from EFI in filesystem” option in your motherboard or equivalent
2. I suggest trying to use the EFI sas2flash first, as the DOS one will often fail under common motherboard models giving errors such as
ERROR: Failed to initialize PAL. Exiting program.
3. Some guides suggest that rebooting would have dire consequences, they lie. Then again they may be right in that a reboot is unnecessary, idk, take control of your life
- Once in the EFI shell, select the USB drive by entering
fs0:
orfs1:
1. You can find which is the USB drive by runningls
2. Enter the SAS2008 folder as per step 7 3. Write the new firmware withsas2flash.efi -o -f 2118it.bin
- Note this will remove the optionROM, if you want it, google the right command
- I don’t need it since I’m not using any raid settings or booting from the controller itself
- BONUS: makes boot faster
4. Update the SAS address with
sas2flash.efi -o -sasadd 500605XXXXXXXXXX
- Substituting the 500605XX… string with your address noted earlier
- Reboot and you’re done
- If you want to do step 12 in the DOS command line, I’ll let you guess how you have to change the two requisite commands in substeps 3 and 4
As of writing the latest LSI firmware version is P20. In FreeNAS (and BSD by extension) you must match the driver with the firmware on your card, and since P20 is the current driver for the release version of FreeNAS, I suggest you use it.