OPNsense Forum

English Forums => General Discussion => Topic started by: hushcoden on July 23, 2026, 07:30:24 PM

Title: Help needed to update bootloader
Post by: hushcoden on July 23, 2026, 07:30:24 PM
My installation is about 3.5 years old, and I read somewhere that before upgrading from v26.1 to v26.7, I should update the disk bootloader. Is that correct?

I ran the following command: ./loaders-update show-me

and this is the output: loaders-update v1.3.2

One or more efi partition(s) have been found.

Examining ada1p1...
mount -t msdosfs /dev/ada1p1 /mnt
Would run: cp /boot/loader.efi /mnt/efi/freebsd/loader.efi
Would run: cp /boot/loader.efi /mnt/efi/boot/bootx64.efi
umount /mnt

Examining ada0p1...
Efi partition ada0p1 is already mounted in /boot/efi.
Would run: cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi
Would run: cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi

One or more freebsd-boot partition(s) have been found.
The root file system is zfs.

Examining ada1...
Would run: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada1

Examining ada0...
Would run: gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0

-------------------------------
Your current boot method is BIOS.
Updatable EFI loader: 4
Updatable BIOS loader: 2
-------------------------------

Could some kind soul guide me on the next steps?

Tia.
Title: Re: Help needed to update bootloader
Post by: Patrick M. Hausen on July 23, 2026, 07:40:45 PM
Not entirely correct. You should uninstall any os-cpu-microcode-* plugin you have installed before upgrading, and update the bootloader after upgrading to 26.7. Because there's an important bootloader bug fix in FreeBSD 15.1. You can then reinstall the microcode plugin.

For updating the bootloader: just use that script. Output looks ok.

Caveat: always have a backup. Create a snapshot before you do anything.
Title: Re: Help needed to update bootloader
Post by: hushcoden on July 23, 2026, 09:20:06 PM
So, (1) remove the intel cpu microcode; (2) upgrade to v26.7; (3) update bootloader.

As for point (3), is there any sort of step-by-step, fool-proof guide?
Title: Re: Help needed to update bootloader
Post by: meyergru on July 23, 2026, 09:23:57 PM
Besides: loaders-update is neither installed nor available on OpnSense, is it?
Title: Re: Help needed to update bootloader
Post by: RES217AIII on July 23, 2026, 09:28:10 PM
Hello.
I'm not sure if I'm in the right place here or if I'm hijacking the forum thread. If so, please accept my apologies.
My installation is getting on in years, too—four years old.
The update to 26.7 went smoothly, as usual.

Many thanks to the team!

However, before I could bring myself to proceed, I closely followed the discussion regarding the bootloader update and the "microcode problem." There were several discussions about it. This raises the question for me: who actually needs a bootloader update? And how do I determine whether I need this bootloader update?
Many thanks,
Bernd
Title: Re: Help needed to update bootloader
Post by: franco on July 23, 2026, 09:46:35 PM
Quote from: meyergru on Today at 09:23:57 PMBesides: loaders-update is neither installed nor available on OpnSense, is it?

May make sense to add it if it's safe for our standard installation modes, but we need to have a few conversations first.


Cheers,
Franco
Title: Re: Help needed to update bootloader
Post by: hushcoden on July 23, 2026, 09:55:50 PM
I'm not particularly tech-savvy, and judging by the number of typos I make, I may well have undiagnosed dyslexia or something similar 😄

So yes, I ask questions that may seem obvious or "silly" to more experienced users. But hey, why someone would spend his/her own time writing unhelpful replies that don't actually answer the question is totally beyond my comprehension.

That said, I must have installed the script at some point in the past, I just don't remember when or why.

I can see the output of the option help, but it doesn't help ma at all:
loaders-update v1.3.2
Usage: loaders-update mode [-befgqry] [-m efi_mount_dir] [-s loaders_source_dir]
mode can be one of:
  show-me: just show the commands to type, change nothing.
  shoot-me: may update the loader(s), but ask for confirmation before each one.
Options:
  -b: scan only BIOS loaders (excludes EFI loaders).
  -e: scan only EFI loaders (excludes BIOS loaders).
  -f: won't check the freebsd-boot content for BIOS loaders update.
  -g: force to use 'gpart show' for disk detection.
  -q: quiet mode. No output to the console.
  -r: won't check the root file system for BIOS loaders update.
  -y: answer yes for shoot-me mode. Use with caution!
Return codes:
  0: no error.
  1: an error occured.
  2: at least one loader isn't up-to-date.
  3: = 1 + 2.

That's precisely why I'm asking about the correct way to update the bootloader, so if anyone knows the current recommended method, I'd genuinely appreciate the information.
Title: Re: Help needed to update bootloader
Post by: Patrick M. Hausen on July 23, 2026, 09:59:08 PM
Quote from: meyergru on Today at 09:23:57 PMBesides: loaders-update is neither installed nor available on OpnSense, is it?

It was mentioned in this topic: https://forum.opnsense.org/index.php?topic=51959.0 including instructions on how to get it:

curl -O https://raw.githubusercontent.com/Emrion/uploaders/refs/heads/main/loaders-update
chmod +x loaders-update
./loaders-update show-me
./loaders-update shoot-me

It's just a script after all.

Quote from: hushcoden on Today at 09:20:06 PMAs for point (3), is there any sort of step-by-step, fool-proof guide?

Use the matching "gpart" invocations for your legacy boot partitions and "mount_msdosfs" followed by a simple copy for your EFI partitions. Or use the script.

There is to my knowledge no better documentation and "fool proof" is difficult because the actual execution depends on a gazillion parameters all individual for each installation. That's why FreeBSD has not yet provided any automated method.

You need to understand

- your partition layout
- where your legacy boot partitions are and how to update them
- where your EFI partitions are and how to update them

Possibly the script will fail because the installer never formatted the EFI partition on your second disk. All of this needs to be taken into account.

If all of your EFI partitions actually contain a valid FAT32 file system the script will probably run just fine and perform everything necessary.

BTW: as @nero355 pointed out Linux is no better in this regard. If you create a mirrored installation you will end up with GRUB only on the first disk. The rest is left as an exercise to the admin.

Sorry I don't have better news. Go ahead and try the script, report any errors you encounter. If e.g. your second EFI partition is really not formatted properly, you can update the first and then just "dd" over the whole partition to the second drive.

If you are familiar with what a partition table is, what "dd" is etc. none of this is a big deal. If you are not go step by step and we will try our best to guide you along.

Kind regards,
Patrick
Title: Re: Help needed to update bootloader
Post by: Patrick M. Hausen on July 23, 2026, 10:02:01 PM
Quote from: RES217AIII on Today at 09:28:10 PMwho actually needs a bootloader update?

Everyone because the bootloader received a fix for a severe bug in FreeBSD 15.1 which was just published and is just now included in OPNsense 26.7. One needs to keep the bootloader updated just like one needs to keep the OS updated. And the FreeBSD project offers very little help with that.

If you have just a single drive, try the loaders-update script. It will probably work out fine.
Title: Re: Help needed to update bootloader
Post by: hushcoden on July 23, 2026, 10:28:54 PM
Thank you Patrick, much appreciated.

And least now I understand that it's completely beyond my capabilities, so will plan a new/fresh install.
Title: Re: Help needed to update bootloader
Post by: Patrick M. Hausen on July 23, 2026, 10:34:41 PM
Quote from: hushcoden on Today at 10:28:54 PMAnd least now I understand that it's completely beyond my capabilities, so will plan a new/fresh install.

Please report back after your fresh install and I can at least guide you through getting the boot loader on the second drive.

If all you ever did was use the OPNsense installer your second drive is not bootable. Not OPNsense's fault! But it's a 50/50 gamble when one drive fails if your system still boots, despite the fact that everything else is properly mirrored.