The full bootable filesystem needed to reset & flash an LSI SAS92xx M1015 SAS controller card (eg, to IT mode), bootable in both DOS & UEFI
You're going to need this later, so whenever you get a chance to pull the card out, find a sticker with a 16 digit hex code and take a photo.
It probably looks something like: 500605Bxxxxxxx
In order to reliably flash one of these cards, there a few different tools we need to use, and a few different bootable environments needed to run these tools.
I've set up this project to make it so the steps to get the environments you need are as straightforward as possible.
- You will just need to copy the same filesystem to both:
- A
DOS
compatible USB - A
UEFI
compatible USB - the only difference is the way you've formatted the USB.
- A
megarec
utility- We need this to wipe the previous firmware and vendor information from the card.
- (this only works in a
DOS
shell)
sas2flash.efi
- We need this to flash the new firmware and SAS address onto the card
- (this probably only works in an
EFI
shell)
- Rufus or a similar tool, for making bootable USBs.
DOS
shell- We need this to run
megarec
- We need this to run
EFI
shell- We need this to run
sas2flash.efi
- We need this to run
sbrempty.bin
- We write this to a device using
megarec
to help clear existing information from it - We use
megarec
to write this to the device.
- We write this to a device using
2118it.bin
:- The target firmware image we're going to flash to the device.
- This firmware allows direct disk passthrough to the host machine.
- An alternative target firmware is
2118ir.bin
, which also supports disk passthrough, but with more hardware RAID features.
- An alternative target firmware is
- We use
sas2flash.efi
to flash this to the device.
- You need a USB stick to boot from.
Set up the USB:
- Use rufus to make a
DOS
USB- For "Boot Selection" choose "FreeDos"
- There's no need to use a disk or ISO image
- Choose
MBR
for the partition scheme.
- Copy everything from the root of this project to the root of the USB.
Wipe the card:
- Plug the USB and boot from it
- Wipe the card:
You can either type:
Or try running the batch script
megarec -writesbr 0 sbrempty.bin megarec -cleanflash 0
TOITMD1.BAT
(does the same thing)
Shut down the system.
- Reboot the machine in UEFI mode. You may need to switch your boot mode into
'UEFI' or if the option of 'Boot from UEFI device' (or file) is available
in your boot menu, select that. If you need to specify a file, use the
supplied
efi/boot/bootx64.efi
shell. - Navigate to the USB filesystem
- The shell should give you a list of filesytems on the device on boot, but you can also use
map
to list them.- You can use PageUp / PageDown keys to scroll
- The actual filesystem ID may vary (It's usually
fs0
, but for me it wasfs1
), but it seems to appear first on the list. - To change filesystems
# The colon at the end is important fs1:
- Confirm you're in the correct place by listing the contents:
You should be able to see the files from this project
dir
- The shell should give you a list of filesytems on the device on boot, but you can also use
- Flash the card
You can type it out by hand:
-
Flash the image
sas2flash -o -f 2118it.bin -b mptsas2.rom
Re-add the card's address
sas2flsh -o -sasadd 500605Bxxxxxxx
Substituting your card's actual address for
500605Bxxxxxxx
Or you can try the batch scriptTOITMD2.BAT
-
If all goes well, you should get some output confirming the flash operation and address write.
Shutdown the system, unplug the USB, and boot normally.
When putting this together, for the most part I didn't plan for it to be reproducible, so I've done my best to retrace my steps and the provinence of the difference components.
- I chose to license this project as GPLv3, based on the assumption that at least one of the binaries in this stack is GPL licensed, and will infect this distribution.
- I haven't bothered checking most licenses too closely, I'll address any license disputes if they come up but I'd be pretty surprised
- I got the original fileset for flashing to P20 from Spearfoot on TrueNas
- I found this via Philip and Dakota Schneider's blog
- The final combination of binaries I needed came from this stack overflow comment
- The [./efi/boot/bootx64.efi] is from tianocore/edk2,
- the specific version I am using plays well with the other binary utils, particularly (
sas2flash.efi
) tianocore/edk2
is BSD licensed, which should
- the specific version I am using plays well with the other binary utils, particularly (
- sas2flash.efi is from broadcom specifically version P20 for UEFI
- The [./efi/boot/bootx64.efi] is from tianocore/edk2,
- GeekGoneOld's comment on truenas was a solid comprehensive reference explaining the process.
- The very first walkthrough I used was a 10 year old guide from servethehome which also gives a solid reference for what IT and IR modes are and why you might want them.