Cross-flash M1015/9420-8i LSI controller quasi-official way

WARNING: don’t blame me if you brick your card ;).

Building large cost effective storage solutions present a problem: lack of cost effective HBAs.
The solution to this problem is an interesting controller from IBM/Lenovo M1015. These can be bought for about 70USD on ebay.
The only problem with that controller is that the firmware it comes with (aka WebBIOS) is utter crap.
This problem can be resolved thanks to LSI providing alternative firmware images.

I generally flash these cards in Pass-Through mode, as they are not suitable for hardware raid scenario (lack of battery and RAM). Besides in low cost situation it is far better to use mdadm RAID (or ZFS) than hardware RAID (due to flexibility in reshaping, monitoring and fault recovery). With hardware RAID you simply cannot start with 3-disk RAID5 and grow it a disk at a time to 12-disk RAID6 without moving data to another storage.

I decided to write this guide as I could not find a guide that would use the tools and firmware images directly acquired from official sources (LSI/Avago/Broadcom).

All the guides include their own download links, which present security (malware) and possible bricking issues (if images were corrupted).

The goal of this guide is to stick to only files sourced from LSI (now Broadcom) as well as avoiding using Windows (Linux friendly).
By the time someone reads this the version and links will change so I am including search keywords on how to find the files in question.

I will be focusing on Pass-Through mode firmware (IT mode), but the only difference to IR mode is the 2118it.bin vs 2118ir.bin.

* Before you start please be aware that the flash tools do not work on all CPU/Motherboard combinations. I had no luck with the motherboards that have Intel graphics chips. I had good success with Dell R610 server.
* You will need an USB flash disk.
* You are comfortable with linux shell
* Write down SAS number from back of the card! It will be in form of 500605B X-XXXX-XXXX

Tools needed:
* FreeDOS live USB (LSI Pre-Boot USB tool)
* megarec.exe
* dos4gw.exe
* sas2flsh.exe
* 2118it.bin
* mptsas2.rom

FreeDOS live USB
The FreeDOS live USB is available (officially!) from LSI, and found via this search:
LSI Pre-Boot USB tool
The LSI_PreBoot_Installer.7z is file of interest.

megarec.exe and dos4gw.exe
megarec.exe and dos4gw.exe are found via this search:
megaraid dos
The actual files of interested are:
MegaRAID SCSI MegaRC – DOS, Version 1.20
MegaRAID SAS MegaCLI – DOS, Version 1.01.39
Note: megacli.exe is not actually needed, only use of that download is to get dos4gw.exe. Alternative source of dos4gw.exe can be found here (just rename dos32a.exe to dos4gw.exe).

sas2flsh.exe, 2118it.bin and mptsas2.rom
sas2flsh.exe, 2118it.bin and mptsas2.rom are found via this search:
9211-8i msdos
The actual file of interest is:

Since I could not find official source of empty SBR image I decided to generate it myself (based on multiple sources of this file)
The file looks like this:

0000000 0000 0000 0000 0000 0000 0000 0000 0000
0000090 0000 0000 0000 0000 ffff ffff ffff ffff
00000a0 ffff ffff ffff ffff ffff ffff ffff ffff

This can be generated using these two commands:
dd if=/dev/zero of=sbrempty.bin bs=152 count=1
dd if=/dev/zero bs=104 count=1 | tr "\000" "\377" >> sbrempty.bin

Live USB preparation.

1) Using your partitioner of choice create one fat32 DOS partition on a usb flash drive (I used 4GB drive).
2) Download LSI_PreBoot_Installer.7z and extract it into a directory.
3) copy ‘boot’ directory (extracted above) to the USB drive.
4) cd into boot/syslinux directory (extracted above) and chmod +x syslinux.
5) assuming your new created partition is /dev/sdb1 run following as root: dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/sdb
6) set boot flag on the flash drive:
parted /dev/sdb set 1 boot on (this can also be done with a gui partition editor tool like gparted).
7) install syslinux on the flash drive (/dev/sdb1 must be mounted):
./syslinux -f -d /boot/syslinux /dev/sdb1. Note: this must be done from boot/syslinux extracted directory (not the OS version of syslinux).
8) create a directory in root of flash drive (lets assume it is named “firmware”)
9) Place megarec.exe, dos4gw.exe, sas2flsh.exe, 2118it.bin, mptsas2.rom and sbrempty.bin (see above for generation instructions) files into newly created directory (see above for download locations).
10) Safely remove drive ;).

Flashing instructions
Note: assuming only one LSI controller installed in the system. Don’t forget to get SAS number (500605BXXXXXXXXX) from the back of the card.

1) Boot into USB
2) Select FreeDOS option in the boot menu
3) Select Option 4 (no drivers) for FreeDOS
4) C: and cd firmware, dir to confirm all files are there (megarec.exe, dos4gw.exe, sas2flsh.exe, 2118it.bin, mptsas2.rom and sbrempty.bin)
5) save current SBR:
megarec.exe -readsbr 0 sbr.bck
this might be useful for recovery(?)
6) Write empty SBR:
megarec.exe -writesbr 0 sbrempty.bin
7) Clear flash:
megarec.exe -cleanflash 0
8) Reboot (important!).
9) repeat 1) through 4)
10) Clean flash area:
sas2flsh -o -e 6
(Not sure if this step is necessary). Type in 2118it.bin when prompted for firmware image
11) Write new firmware:
sas2flsh -o -f 2118it.bin -b mptsas2.rom
12) Program original SAS address:
sas2flsh -o -sasadd 500605BXXXXXXXXX
Note: replace 500605BXXXXXXXXX with the number on your card (omit ‘-‘).
13) Done

As alternative sas2flsh tool exists for linux and all the sas2flsh steps could be done from comfort of your Linux distro.

Note: neither linux sas2flash tool or DOS tool works with consumer Intel UEFI chipsets (gets a “PAL” error). To work around this you must use the EFI version of the tool and some EFI shell.

Update: it seems that ver. 20 of the firmware causes cards not to see the drives (the cards are recognised OK in the BIOS and Linux, as well as the Ctrl+C menu after POST works OK). I downgraded the firmware to 14 and the drives came back OK.

Leave a Reply

Your email address will not be published. Required fields are marked *