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.

  1. 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
  2. Make a bootable USB drive
    1. Make it both UEFI and DOS bootable, using the DR-DOS image
    2. Download an EFI shell, rename the file to shellx64.efi and place it in the root of the USB drive
    3. Create a folder in the root named SAS2008
  3. Download the LSI utilities and unzip them all in the SAS2008 folder
  4. Go to the LSI9211 downloads page and download the following files under firmware:
    1. Installer for UEFI
    2. Installer for MSDOS and Windows
    3. Firmware package IR and IT
  5. From these copy the following files to the SAS2008 folder:
    1. \sas2flash_dos_rel\sas2flsh.exe
    2. \Firmware\HBA_9211_8i_IT\2118it.bin
    3. \sas2flash_efi_ebc_rel\sas2flash.efi
  6. Now boot your computer from the USB drive, selecting the non-EFI mode first
    1. How you do this will depend on your exact motherboard
  7. Navigate to the SAS2008 directory by using the cd command
  8. First we have to clear the firmware by running megarec.exe -writesbr 0 sbrempty.bin
  9. Now we clear the flash megarec.exe -cleanflash 0
  10. Reboot your computer and select EFI boot this time 1. Sometimes this may not work for the following reasons:
    1. Mysteries
    2. You have secureboot enabled
    3. 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
  11. Once in the EFI shell, select the USB drive by entering fs0: or fs1: 1. You can find which is the USB drive by running ls 2. Enter the SAS2008 folder as per step 7 3. Write the new firmware with sas2flash.efi -o -f 2118it.bin
    1. Note this will remove the optionROM, if you want it, google the right command
    2. I don’t need it since I’m not using any raid settings or booting from the controller itself
    3. BONUS: makes boot faster 4. Update the SAS address with sas2flash.efi -o -sasadd 500605XXXXXXXXXX
    4. Substituting the 500605XX… string with your address noted earlier
  12. Reboot and you’re done
  13. 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.