Dell PERC H310 raid card flashed to IT Mode

6 minute read

SAS HBA (Host Bus Adapter) cards can be expensive, RAID cards are much cheaper. How does that make sense? They’re electronically identical? Well I can’t answer that, but I can tell you how to reflash your PERC H310 (and similar) cards to the firmware of the LSI 9211-8i card, an actual HBA.

Preparation

Files

You’re going to need the following files:

  • sbrempty.bin
    • simply a 256bit file filled with 00 and FF bytes. Can be created with the following command on linux:
      (dd if=/dev/zero bs=1 count=152; dd if=/dev/zero bs=1 count=104 | tr '\000' '\377' ) > sbrempty2.bin
      
  • megacli.exe (Optional, recommended)
    • Required only to get the card’s SAS address. This information may also be physically printed on the card somewhere, so it’s not strictly necessary.
  • megarec.exe (Optional, recommended)
    • Can be used to erase the flash on a DOS system. sas2flash can also do the same, though it appears to be less reliable.
  • sas2flsh.exe/sas2flash.efi
    • Use to flash new firmware to the card.
    • Also used to add your SAS address (or technically any address you want) back into the firmware after flashing.

I’m not going to link any of these files here, because Broadcom, being, well, Broadcom, has removed the download links from their site. Check some of the other guides at the end of this page, they have copies of all the files needed.

The sas2flash utility (both efi and dos binaries) exists in two versions:

  • ‘P05’ - 5.00.00.00 2010.02.10
  • ‘P19’ - 19.00.00.00 2014.03.17

For reflashing this card (and many other Dell cards), you want P05, not P19. I will explain why later.

In addition to this, you will probably require a FreeDOS USB stick. The easiest way to make one is via Rufus on Windows. On Linux, you can follow this guide.

Additionally, you may want an EFI shell if your motherboard does not have a “boot to EFI shell” option in the BIOS options. Simply grab any EFI shell e.g., the EDK2 shell from the section below, and place it in [USB ROOT]/EFI/BOOT/shellx64.efi and a copy in [USB ROOT]/EFI/BOOT/bootx64.efi.

To UEFI or not to UEFI - ERROR: Failed to initialize PAL

There exist two sets of binaries for the sas2flash utility: one for UEFI systems and one for DOS. I would suggest trying both. Usually, the UEFI executables will not work properly on modern systems.

If you find an error like Failed to initialize PAL when running sas2flash.efi, this is an issue with the UEFI shell you are running. PAL errors refer to the platform abstraction layer, a piece of code which allows sas2flash to be easily ported to different systems. What this effectively means is the UEFI is blocking calls to access the firmware of the raid card. In this case, you can either try a different UEFI shell (especially if you were using a shell booted directly from the motherboard’s setup menu), or try FreeDOS.

That being said, this same error can also crop up on DOS, where it is usually caused by a lack of the BIOS32 service directory feature. 1. Again, try the EFI method, particularly a separate shell, like the one from EDK2.

It may also be possible that some setting like secure boot is still enabled, which would also prevent some APIs being inaccessible, however this would usually make it impossible to boot a UEFI shell or FreeDOS in the first place.

SAS address

You will need to make note of the SAS address of the card. If you are running a headless server it may be easiest to read it from the card’s firmware directly, otherwise (or if you forgot before clearing the flash) you can still get the SAS address from the sticker on the back of the card.

The following command will print a lot of information, look for a line stating “SAS Address”:

megacli.exe -AdpAllInfo -aAll -page 20

The address should be in the format 500xxxxxxxxxxxxx.

Wipe firmware

I would recommend trying to do this via the megarec executable, in FreeDOS, using the following commands:

megarec.exe -writesbr 0 sbrempty.bin
megarec.exe -cleanflash 0

Reboot after this step.

Do not worry if the first command seemingly fails, move on to the second command anyway.

It is also possible to use the sas2flash binary within the EFI shell, using one of these two commands:

sas2flash.efi -c 0 -o -e 6
sas2flash.efi -c 0 -o -e 7

The first clears everything, excluding some manufacturer data. This should suffice, however if the flashing procedure does not work, it is possible to clear the entire flash with -e 7. This can and has led to bricks, so proceed with caution! Though it rarely ever does.. 2

The general consensus seems to be that the sas2flash erase command is too unreliable, so it is recommended to always use megarec where possible, even if you switch back to the EFI shell to flash the new firmware.

Motherboard won’t boot

As I said, it is extremely rare for a brick to occur, but if you do somehow manage to find yourself with a motherboard that won’t boot, don’t worry.

  • Remove the card from the system
  • Reboot into BIOS
  • Disable optionROM support, usually hidden somewhere in boot or CSM/compatibility settings
  • Plug the card back in and erase the card’s flash again via megarec
  • Proceed with flashing

Just remember to re-enable optionROM support later if you want it.

Flash new firmware

This is where it gets tricky. You will not be able to flash the LSI9211 firmware (2118it.bin or 2118ir.bin) directly. You need to flash another binary, namely that of the Dell 6Gbps HBA card first.

Dell 6Gbps SAS HBA

First of all, run the following command (substituting sas2flsh for the correct binary name and extension for UEFI or DOS):

sas2flsh -o -f 6GBPSAS.fw

Reboot before attempting to flash the LSI 9211 firmware.

LSI9211

Now we can flash the actual firmware we want.

sas2flsh -o -f 2118it.bin -b mptsas2.rom

OptionROM

The -b mptsas2.rom part is not necessary if you don’t want optionROM support (the splash screen you see when booting a system with a SAS card, and the settings page which can be accessed from said splash screen). That is unless you want to flash the “IR Mode” (usually 2118ir.bin) firmware, in which case you will need optionROM support to access any of the hardware RAID settings.

ERROR: Cannot Flash IT Firmware over IR Firmware

This is where it is important that you have the P05 version of sas2flash. The reason is the newer version will not allow you to flash IT mode firmware over IR mode. The older version will, albeit with asking for confirmation.

If you get the error Cannot Flash IT Firmware over IR Firmware, it is because you are not using sas2flash P05.

Rewrite SAS address

Hopefully you should have written down the SAS address earlier. If you haven’t, and it’s not physically printed on the card, you can always make something up. Any string of 16 numbers and letters should work, and it will only become an issue if you plug in another card with the exact same SAS address (very unlikely). In fact, it’s about a chance of 1 in 8×10²⁴.

sas2flsh -o -sasadd 500xxxxxxxxxxxxx

Substitute the x’s for the actual address of course.

And that’s it.. reboot and enjoy your new, much more useful, and dirt cheap HBA card.

Links and resources

Comments