Confusingboat / flash-it

Easy one-step flashing for LSI SAS2-based HBA/RAID devices
GNU Affero General Public License v3.0
104 stars 30 forks source link

Bootable IT mode? #23

Closed bakgwailo closed 3 years ago

bakgwailo commented 3 years ago

Ran the script (Debian buster, dell r220), and things kind of went OK - there was a failure at one point, and when it was attempting to reset/rescan, it ended up killing/freezing my SSH, and things were also hard looked up in the IDRAC console. A downside, also, was because of the reset I lost all of the backups in /tmp. However, I hard rebooted, and I think it actually works. The OS can see connected drivers, and the Dell bios/firmware no longer recognizes it as a RAID controller.

The only thing I cannot get working is using an attached drive as a boot device. Is there any way to do this? I have read with other methods that this is generally the flash just firmware vs firmware and bios back (using sas2flash). Figured I would at least see if this is possible with lsirec.

Confusingboat commented 3 years ago

If executed to completion, this script does allow bootable devices in both BIOS and UEFI modes since it flashes both of those boot ROMs.

Your card didn't get these ROMs flashed since your system locked up at one of the device resets, and flashing the boot ROMs is the very last thing in the script. Without logs it's difficult to say exactly what went wrong, but it happened either directly after the firmware flash or after setting the WWN/SAS address; it should be easy to tell which one it was by whether or not your adapter has a SAS address assigned to it.

You should be able to perform both of the aforementioned steps manually using lsiutil. To preface, you'll have to setup the environment, download the necessary boot ROM files, and set the vars referenced by the commands (or just replace them with inline strings) before running them, but you already knew that 😉

First, to set the SAS address if necessary:

lsiutil/lsiutil -p1 -a 18,${SAS_ADDRESS},0

Now you need to either reset the device using lsirec reset or by rebooting the server. Considering what happened last time I would recommend just rebooting.

The next step is to flash the boot ROMs:

lsiutil/lsiutil -p1 -a 4,yes,0 -f "${BIOS_FILE_PATH}",,"${UEFI_FILE_PATH}"

Once you're done flashing, reboot the server and you should be able to enter the boot ROM with CTRL + C like normal and set a bootable disk.

bakgwailo commented 3 years ago

OK, so just going to edit/update: No idea how to find the old SAS id since the backups got cleaned out of /tmp on the hard reset. So, I made one up. Set it via the above command, rebooted, and then ran the flashing command. on Reboot (and swap the drive to the h310), I got the SAS bios boot page again, and I am able to boot into my OS. Looks like everything is good - appreciate the help. I think at least I am not successfully in IT mode.

Confusingboat commented 3 years ago

Sounds like you are good to go and in IT mode then!

Thanks for bringing this up as well, I may add a pre-flight test to the script to make sure device resets work properly on a system before making changes to prevent something like this from happening to others.