Post upgrade steps for ZFS - Major Upgrade

Started by ProximusAl, Today at 08:48:38 AM

Previous topic - Next topic
Hey All,

Quick Question. 

I've just upgraded one of my IPv6 OPNSense DEC 750v2 to 26.1.
I haven't migrated the rules over yet, going to wait until the water is settled before that.

With my installs all being ZFS is it still recommended to do this after a major upgrade:

cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi
cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi

I have this in my notes, but blatantly forgot *why* I have this in my notes, but recall it is something to do with ZFS and the pool.

Thanks for any advice.
Hardware:
DEC750

Small note: the boot code does not change from 25.7 to 26.1 as it's the same OS version.


Cheers,
Franco

Only if you upgrade your zpool. But in that case a definite yes.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on Today at 09:20:52 AMOnly if you upgrade your zpool. But in that case a definite yes.

I'm assuming even if I *don't* upgrade my zpool (not sure why I would ever do that in my case), there is no harm in doing this after every major upgrade?

In this instance I won't need to due to @franco comments. (Thanks, that helps)
Hardware:
DEC750

> there is no harm in doing this after every major upgrade?

No harm if it works, small risk if something goes wrong. But that's always the case when editing such critical things.


Cheers,
Franco

Today at 10:21:37 AM #5 Last Edit: Today at 10:23:49 AM by vk2him
Quote from: ProximusAl on Today at 08:48:38 AMWith my installs all being ZFS is it still recommended to do this after a major upgrade:

cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi
cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi

Sorry to hijack this thread - I just listed these files on my OPNsense 25.7.11_9-amd64 system:

root@OPNsense:~ # ls -l /boot/loader.efi
-r-xr-xr-x  2 root wheel 658944 Jan 13 23:26 /boot/loader.efi
root@OPNsense:~ # ls -l /boot/efi/efi/freebsd/loader.efi
-rwxr-xr-x  1 root wheel 890368 May 31  2022 /boot/efi/efi/freebsd/loader.efi
root@OPNsense:~ # ls -l /boot/efi/efi/boot/bootx64.efi
-rwxr-xr-x  1 root wheel 658944 Jan 30 18:28 /boot/efi/efi/boot/bootx64.efi

Looking at the dates, /boot/efi/efi/freebsd/loader.efi is from 2022 and a different filesize, and the others are the same size but different dates and I assume they are the same file.

I should I copy /boot/loader.efi to /boot/efi/efi/freebsd/loader.efi to fix this? I wonder why I haven't (yet?) seen any issues?

Thanks

There is nothing to fix. You only need to update the boot loader if the ZFS features of your local pool change. If you run on UFS you don't need to update it at all.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on Today at 10:55:50 AMYou only need to update the boot loader if the ZFS features of your local pool change.

Unless we do this manually for some reason, is there ever a need to do this after a major version upgrade (of say FreeBSD)?

How would we know from the OPNsense upgrade process if this needs to be done?  Are there warnings posted somewhere, like in the release notes?

ZFS pool upgrades are never applied automatically. You need to explicitly use "zpool upgrade zroot". And if you do this, then remember to also upgrade your boot loader.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Today at 11:33:15 AM #9 Last Edit: Today at 11:35:48 AM by vk2him
Quote from: Patrick M. Hausen on Today at 11:25:57 AMZFS pool upgrades are never applied automatically. You need to explicitly use "zpool upgrade zroot". And if you do this, then remember to also upgrade your boot loader.

As further context to my question, coincidentally today the second of two disks in my ZFS Raid pool died, so rather than replace it, I detached it from the pool and did a zpool update. However I didn't upgrade the boot loader as I overlooked that step :(

I tried to reboot but it failed as it couldn't find a bootable disk, so I booted off usb and copied the loader.efi from the usb to /boot/efi/efi/boot/bootx64.efi - thats probably why that file has today's date.

The pool is showing no errors now:
# zpool status
  pool: zroot
 state: ONLINE
  scan: resilvered 4.26G in 20483 days 03:18:56 with 0 errors on Fri Jan 30 14:19:00 2026
config:

NAME        STATE     READ WRITE CKSUM
zroot       ONLINE       0     0     0
  ada0p4    ONLINE       0     0     0

errors: No known data errors

So I'm now assuming I'll need to copy it to /boot/efi/efi/freebsd/loader.efi as that file is from 2022?



Thanks

/boot/efi/efi/freebsd/loader.efi and /boot/efi/efi/boot/bootx64.efi should be identical, although only one will be used. Which one depends on your BIOS and its settings.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

I already had problem by not updating bootloader (running opnsense for long time and multiple upgrades and freebsd version increases)
There is whole discussion
https://forum.opnsense.org/index.php?topic=48145.msg242901#msg242901

Quote from: Patrick M. Hausen on Today at 11:43:18 AM/boot/efi/efi/freebsd/loader.efi and /boot/efi/efi/boot/bootx64.efi should be identical, although only one will be used. Which one depends on your BIOS and its settings.

I've now ensured that both are identical - I think I should be ok now - thanks for your assistance @Patrick