• Post last modified:May 28, 2020
  • Post Comments:0 Comments

Erasing the BIOS on an LSI SAS Controller for Faster Startup

Introduction

Late last year the storage array on my custom-built Unraid server exceeded the default hard drive capacity of my motherboard after a few too many impulse buys of deeply discounted Western Digital 10TB external hard drives at Best Buy.

After scouring the internet for a solution that didn’t require a major upgrade to my server’s hardware, I found a guide on ServerBuilds.net outlining how to increase storage capacity utilizing an LSI SAS controller, which if configured correctly (and with a few extra pieces of hardware), would allow one to install an additional 16 hard drives onto a motherboard.

I quickly purchased the hardware, including an LSI SAS9201-16e controller, and integrated it into my existing hardware. While the increase in storage capacity right off the bat was great, I noticed almost immediately that my boot times had increased significantly – up to an additional 5 to 10 minutes – because of the LSI SAS controller’s BIOS screen.

After some research, I discovered that the BIOS wasn’t exactly flying through the boot process because these SAS controllers are typically installed in business-grade setups where servers aren’t necessarily restarted with any regularity.

I, however, did not care for the increased boot time and discovered that the BIOS wasn’t necessary for my consumer-grade hardware, and quickly scoured the LSI SAS documentation for a way to disable it. To my relief, after some trial and error I was able to erase the BIOS and my boot times are now back to where they were before – even with the additional hard drive capacity.

If you’re looking to do the same, check out the guide below.

What We’ll Need

Disclaimer: This is probably the ideal time to call out that erasing the LSI SAS controller’s BIOS is only an option if the hard drive containing your operating system isn’t connected via the SAS controller. If it is, try to rearrange your motherboard connections so that hard drive your machine uses to boot is connected directly to the motherboard.

While I found this process to be infinitely easier than actually flashing new firmware onto the LSI SAS controllers, there are still a few things we’ll need before we get started:

  • A server with an LSI SAS controller installed (this should work for most LSI models)
  • A blank USB flash drive
  • Fat32format application to format the flash drive
  • The sas2flash.efi file from this download to be copied onto the flash drive
  • The “Shell_Full.efi” file from this GitHub repository

Preparing the Flash Drive

Before we can erase the LSI controller’s BIOS, we’ll need to create a bootable flash drive with the files from above.

To start, plug your flash drive into your computer, open the FAT32 Format application from above, and – using the default values – select your flashdrive from the dropdown and click “Start”.

Once it has been formatted, create the following directories in the root of the flash drive:

/boot/efi/
/efi/boot/

(One of the directories above doesn’t actually do anything – in my attempts to do this, I found various recommendations across the internet that suggested both, and at the end of the day, I’m not actually sure which worked for me – so include both to be safe.)

Next, take the Shell_Full.efi file from above and place two copies in each of the directories.

Rename one of the copies “bootx64.efi” and one to “shellx64.efi” (same as above – multiple people recommended each, and I’m not sure which one actually did the trick, so include both).

At the same time, also copy the sas2flash.efi tool found in the Installer_P20_for_UEFI archive that you had downloaded earlier and copy it into each of the two directories.

When finished, the contents of your flash drive should look like this:

Booting From the Flash Drive

Now that the flash drive is ready, plug it into the server with the LSI SAS controller.

Before we attempt to boot from it, you’ll want to shut it down and unplug any cables that might be plugged into the LSI SAS controller (the cable that splits to each of the hard drives). This will prevent us from doing any damage to the data on the drives on the off-chance that anything goes wrong in the following steps.

From there, restart your server, enter your motherboard’s BIOS menu, and configure the boot menu to boot from your flash drive. Before you restart, you may need to disable “Secure Boot” in your BIOS settings, so go ahead and do that as well.

Erasing the BIOS From the Shell

If you followed the above steps correctly, your server should boot into the shell we created on your flash drive and you’re now ready to erase the BIOS.

To do this, we’ll reference the sas2flash.efi tool you had copied onto your flash drive to perform a few tasks.

To start, let’s take a look at and confirm your controller’s info. Enter the following command and take note of the BIOS version number:

sas2flash -list

Next, let’s run the command to erase just the BIOS from your controller (the glossary of available commands can be found in sas2flash’s documentation):

sas2flash -o -e 5

The “-o” is the argument to enter the advanced mode, the “-e” references the command to erase a section, and “5” is the parameter for the controller’s boot services.

Once you’ve entered that, run the following command again and ensure the BIOS version now says “N/A” instead of a numerical value:

sas2flash -list

If you followed the steps above, your controller’s BIOS should now be erased. Go ahead and type “exit” to exit the shell and shut down your server.

Plug any cables back in to your LSI controller, remove your flash drive, and reboot your machine. You should find it now skips the LSI SAS BIOS screen entirely now and goes straight to your operating system’s boot sequence.

Conclusion

While this change might be more of a “nice-to-have” than a “must-have”, disabling the BIOS has definitely made me less reluctant to reboot my server when performing maintenance, and I hope you find some value in it as well.

Feel free to leave a comment below if you have any questions or feedback.

If you’ve found this or any of the other posts on SHIFT14 helpful, please consider supporting the site through a one-time PayPal donation or ongoing support through Patreon. My goal is to continue providing in-depth guides for the technical community and the support helps justify the time and resources spent doing so.

Leave a Reply