Unable to boot after BIOS chip replacement on motherboard

I am hoping that I can get some help with my system. I have a Supermicro X9SCM-F motherboard that suffered from this BIOS bug. Some details can be found here.
I was not able to boot to my FreeBSD system at all and was not able to complete the BIOS 2.3 update as I was not able to boot into FreeDOS due to another BIOS bug. So, I was stuck and ordered a new BIOS chip with the latest BIOS already burned to it (thanks ebay seller). I replaced the chip and while the system does post now, I am unable to boot into my FreeBSD system. It's like there is no bootable OS on it. I am able to boot into any OS from a flash drive and even installed FreeBSD on a separate hard drive.

My old drive is ada1 (932G) which I am even able to mount and read data from it.
My new drive is ada0 (298G) which boots fine.

Any pointers on how I can start tackling this issue? I would very much like to boot into my old system as I have many things configured there.

My gpart show:
Code:
=>       40  625142368  ada0  GPT  (298G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528   16777216     3  freebsd-swap  (8.0G)
   17311744  607830016     4  freebsd-zfs  (290G)
  625141760        648        - free -  (324K)

=>        6  244190635  ada1  GPT  (932G)
          6      51200     1  efi  (200M)
      51206        128     2  freebsd-boot  (512K)
      51334        122        - free -  (488K)
      51456     524288     3  freebsd-swap  (2.0G)
     575744  243614720     4  freebsd-zfs  (929G)
  244190464        177        - free -  (708K)

A short video of my system post going into loop:
View: https://youtu.be/1OaQxtgezaM
 
It's trying to PXE (network) boot. After you replaced the BIOS did you go in the BIOS and loaded the BIOS defaults? You could have some settings left over from the old BIOS that might be interfering. Then have a look at the boot order and/or boot options. Disable secure boot (if it's available). Not sure if these can do UEFI boot but definitely check. Your disks have both efi and freebsd-boot partitions so you should be able to use EUFI or CSM (traditional BIOS boot).

I am able to boot into any OS from a flash drive
You can boot the FreeBSD install media? You may want to rewrite both boot partitions, just to make sure they're not corrupt. You can do this from the "shell" option of the install media.
 
Yes, I have reset the settings after putting in the chip. I can boot just fine from other hard drives or USB drives. For some reason it does not want to boot from my old hard drive.

boot options.PNG
 
It does appear to recognize the drive, or at least a drive, a Seagate 1TB drive by the looks of it. That's good. In that case try booting from the install media flash drive and recreating the bootcode. Maybe something got messed up there.

Maybe at some point you wrote the gptzfsboot(8) bootcode to the efi partition? That seems to be a fairly common mistake to make. All gpart(8) bootcode examples use index 1, and that's your efi partition. In your case you need to use index 2, because the freebsd-boot partition is the second partition on your disks.
 
The Seagate 1TB is my old drive that is not able to boot. I ran the following.
gpart bootcode ada1.png


It still won't boot from my old drive. Removed any other drive from the system and even chose from the bios to boot directly to that drive.
 
Your drive also have EFI partition so you should be able to disable secure boot from the bios and set it to boot via UEFI but you will need to install new EFI boot record using efibootmgr(8)
 
Your drive also have EFI partition so you should be able to disable secure boot from the bios and set it to boot via UEFI but you will need to install new EFI boot record using efibootmgr(8)
Unfortunately, efibootmgr(8) only manages entries of UEFI boot manager and does nothing to the boot codes themselves.
You still need to install / update boot codes (boot1.efi or loader.efi) to proper location in ESP (such as freebsd/loader.efi or UEFI default efi/boot/BOOTx64.efi [for amd64]), and if non-UEFI-DEFAULT location is used and it is not yet registered to UEFI boot manager, registering it with efibootmgr(8) is mandatory.
 
Bios chip stores some other data than main BIOS firmware.
Some intel-based systems may have additional modules stored in the BIOS chip.
Intel ME region, for example.
Usually, BIOS update file does not have any information to program "ME region" or some other info stored in the same BIOS chip.
For case when you are writting BIOS update file to the new BIOS chip using chip-programmer you may got clean other regions of BIOS chip.
Unprogrammed (clean) ME region may affect some functions related to the intel chipset like " temperature/cooler management", MAC-addresses of LAN adapters, etc.
As far as I know, you may need to transfer the data related to BIOS ME region from the old chip to the new chip.

So in case of unpredicted behaviour after programming BIOS chip on the programmer be sure to transfer ALL required information from the old chip.

Also I had an issue when some mainboard does not recognize some BIOS chip of different vendor even if the new chip was 100% correctly programmed.
 
After you replaced the BIOS did you go in the BIOS and loaded the BIOS defaults? You could have some settings left over from the old BIOS that might be interfering.
I had a similar boot loop with another Supermicro X9 board.
Loading the BIOS defaults did not help.
But the problem disappeared after I disconnected the PC from the grid, removed the CR2032 and let the board discharge for some minutes.
 
Thank you all for responding. I was away for some days.
Your drive also have EFI partition so you should be able to disable secure boot from the bios and set it to boot via UEFI but you will need to install new EFI boot record using efibootmgr(8)
I don't see an option in BIOS to disable secure boot. I can see and choose to boot UEFI or Legacy.
Can you give me an example of what I need to do with efibootmgr?

As far as I know, you may need to transfer the data related to BIOS ME region from the old chip to the new chip.
This motherboard Supermicro X9SCM-F has a Intel C204 chipset that does not support Intel ME.
So in case of unpredicted behaviour after programming BIOS chip on the programmer be sure to transfer ALL required information from the old chip.
I did not copy the BIOS from the old chip as it was corrupted and ordered a new chip pre-programed.
Also I had an issue when some mainboard does not recognize some BIOS chip of different vendor even if the new chip was 100% correctly programmed.
The board recognizes the chip. I am able to boot into other OS from a different hard drive as seen from the screenshot in my previous post.

I had a similar boot loop with another Supermicro X9 board.
Loading the BIOS defaults did not help.
But the problem disappeared after I disconnected the PC from the grid, removed the CR2032 and let the board discharge for some minutes.
This did not work for me unfortunately. But I am able to boot onto other hard drives on the same motherboard.

Unfortunately, efibootmgr(8) only manages entries of UEFI boot manager and does nothing to the boot codes themselves.
You still need to install / update boot codes (boot1.efi or loader.efi) to proper location in ESP (such as freebsd/loader.efi or UEFI default efi/boot/BOOTx64.efi [for amd64]), and if non-UEFI-DEFAULT location is used and it is not yet registered to UEFI boot manager, registering it with efibootmgr(8) is mandatory.
I would help if you could give me an example of what I need to do here.

To make matters more difficult the two FreeBSD versions I am working with on this system are different. The old and unbootable drive is FreeBSD 11 or 12, don't know for sure and the new drive that I am testing the system with is FreeBSD 13.2
 
Can you give me an example of what I need to do with efibootmgr?
Leave only one disk attached with FreeBSD 13.2 to the server connected on I-SATA#0 port.
Create a bootable USB flash drive using FreeBSD-13.2-RELEASE-amd64-memstick.img connect the USB flash drive to the server, enter in the bios and select UEFI only for boot then save&exit / restart and enter for the second time to the BIOS then select the USB flash drive as first boot device, it should be listed as "UEFI USB Hard Disk" OR "UEFI {USB Manufacture name} Hard Disk" then save&exit to boot from the USB.

After you boot from the USB select on the first screen select "LIVE CD" and login using root without password.


List all GUID efimedia records using gpart list ada0 | grep efi look for Index 1 like
HD(1,GPT,XXXXX)
type: efi

Then list all UEFI boot records using efibootmgr -v and check for the same boot variable:
Boot{number} FreeBSD HD (1,GPT,.../File(\efi\freebsd\loader.efi)
OR
/efi/boot/BootX64.efi
/efi/freebsd/loader.efi
/efi/freebsd/BootX64.efi

If it doesn't exist OR it's different GUID number you can create a new boot record (variable) using this

List the disk using gpart show look for the device name (ada0 or da0) and Index number of the efi partition.
Code:
=>        6  244190635  ada0  GPT  (932G)
          6      51200     1  efi  (200M)
      51206        128     2  freebsd-boot  (512K)
      51334        122        - free -  (488K)
      51456     524288     3  freebsd-swap  (2.0G)
     575744  243614720     4  freebsd-zfs  (929G)
  244190464        177        - free -  (708K)

mount the ESP (efi) partition under /mnt
mount_msdosfs /dev/ada0p1 /mnt

Compare the version of the BOOTx64.efi or loader.efi located in /mnt/efi/EFI/FreeBSD/ /mnt/efi/freebsd or /efi/boot/ with the loader.efi from the USB drive at /boot/loader.efi
md5 /boot/loader.efi /mnt/efi/freebsd/loader.efi
If the checksum are not the same this mean that the loader.efi or bootx64.efi located on the ESP partition is older/different than the current one from the USB drive. You may want to make a backup of this file first so it can be restored if it's needed again.

Let's say if the loader is from FreeBSD12 we can make a copy of it with
cp /mnt/efi/freebsd/loader.efi /mnt/efi/freebsd/loader-FreeBSD12.efi

Then copy the FreeBSD 13 loader.efi from the USB disk to the ESP
cp /boot/loader.efi /mnt/efi/freebsd/loader.efi

Then create a new UEFI boot entry and activate it as next boot using
efibootmgr -a -c -l /mnt/efi/freebsd/loader.efi -L FreeBSD-13

Then you can reboot the server shutdown -r now enter in the bios and check for the UEFI boot entry (UEFI FreeBSD-13)

If there's NO boot entry found during the UEFI boot it will fallback the following path for AMD64 \EFI\Boot\bootx64.efi That's why if you move around the disk you can copy and rename the same loader.efi file and place it under /mnt/EFI/Boot/bootx64.efi so if you are missing the boot entry on another motherboard it will still find the ESP partition and boot from it via \EFI\Boot\bootx64.efi

The loader.efi doesn't have valid UEFI certificate key prebuild on the manufactures motherboards that's why if you bios have a option to disable "Secure Boot" it must be selected, otherwise only validated .efi files with valid certificate can be loaded. As your bios is very old it may not have such "secure boot" option. The same is valid if you try to boot from USB UEFI file.
More detailed information with example for Secure boot on X12 MB can be viewed here:
 
Back
Top