Late-breaking FreeBSD 14 breakage

This might be a dumb question.

After doing the
freebsd-update fetch
freebsd-update install

on a 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64 and after rebooting shouldn't it say FreeBSD 13.2-RELEASE-p5 GENERIC amd64?

Note, the freebsd-update install said there wasn't anything to install for P5.
Did you do another 'freebsd-update install' after the reboot?
 
Did you do another 'freebsd-update install' after the reboot?

In the context of the major upgrade to 14.0-RELEASE, that wouldn't be appropriate.

The fetch and install commands would be followed (with or without a restart) by the upgrade command.
 
Mount the partition (if it's not mounted already)
mount -t msdosfs /dev/ada0p1 /boot/efi (Use the correct disk and partition for your system; look at gpart show)
cp /boot/loader.efi /boot/efi/EFI/BOOT/Bootx64.efi The 'target' directory and filename (EFI/BOOT/BOOTx64.efi) is on a FAT filesystem, FAT isn't case sensitive, so the exact case may be different on your system, case doesn't matter. Certain installations may also have created a EFI/FreeBSD/loader.efi, copy /boot/loader.efi to that too, just for good measure.

Some older installations may have a created a buggy FAT partition. You could get an error saying loader.efi doesn't fit even though the filesystem appears to be large enough. Then you may need to newfs_msdos(8) it first.

While I didn't run into a bootloader problem when doing my initial 13.2 to 14.0 upgrade, I did when I rebooted after installing the latest patch. Fortunately this was all I needed to do to fix it (so thanks), but one thing I don't understand is why this only needed to be done to one disk?

The server in question has two disks, nda0 and nda1, which are configured with ZFS in RAID 1. I made the update to nda0p1 successfully, but it wouldn't even let me mount nda1p1, even though it should have been the same filesystem. Since in the boot menus I just have a single "FreeBSD" item instead of a list of bootable disks, I assume this some kind of virtual disk that the bootloader knows to mirror? Or is something else going on? If my nda0 disk were to fail, it should still boot from nda1 even though I didn't update the bootloader on nda1p1, correct?


Code:
user@server:~ $ gpart show nda0 nda1
=>        40  1000215136  nda0  GPT  (477G)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528     4194304     3  freebsd-swap  (2.0G)
     4728832   995485696     4  freebsd-zfs  (475G)
  1000214528         648        - free -  (324K)

=>        40  1000215136  nda1  GPT  (477G)
          40      532480     1  efi  (260M)
      532520        1024     2  freebsd-boot  (512K)
      533544         984        - free -  (492K)
      534528     4194304     3  freebsd-swap  (2.0G)
     4728832   995485696     4  freebsd-zfs  (475G)
  1000214528         648        - free -  (324K)

user@server:~ $ zpool status
  pool: poolname
 state: ONLINE
  scan: scrub repaired 0B in 00:00:28 with 0 errors on Sat Oct 28 04:46:03 2023
config:
       NAME            STATE     READ WRITE CKSUM
        poolname          ONLINE       0     0     0
          mirror-0      ONLINE       0     0     0
            nda0p4.eli  ONLINE       0     0     0
            nda1p4.eli  ONLINE       0     0     0

errors: No known data errors
 
but one thing I don't understand is why this only needed to be done to one disk?
It has to be done on both disks. If you only updated nda0 the system is going to fail to boot if that drive fails.
but it wouldn't even let me mount nda1p1, even though it should have been the same filesystem.
It's not the same filesystem. The efi partition isn't mirrored. Only your ZFS pool is. Besides that, a BIOS/UEFI has no notion of mirrors, RAID or anything like that. It only loads stuff from a single disk. Don't have to keep this mounted in any case, only mount the efi partition if/when you update the boot code. Just leave it unmounted the rest of the time.
 
It has to be done on both disks. If you only updated nda0 the system is going to fail to boot if that drive fails.

It's not the same filesystem. The efi partition isn't mirrored. Only your ZFS pool is.

That's what I thought, but if so why would it not let me mount the second one in the same way as the first? While in single user mode # mount -t msdosfs /dev/nda0p1 /boot/efi worked just fine, but # mount -t msdosfs /dev/nda1p1 /boot/efi was giving an invalid fs type error (or something, I've already closed the kvm window so I can't verify). Verified several times that I ran the command correctly too, even paging up to the nda0 command I'd previously run and just arrowing over to replace the 0 with a 1.

Thinking back, it's possible I didn't unmount nda0p1 first, but I think it still would have mounted over top of it even so.

Tried running the same commands on the live server just to see, and it gives a different message when I try nda1p1:
Code:
root@server:~ # mount -t msdosfs /dev/nda1p1 /boot/efi
mount_msdosfs: /dev/nda1p1: Invalid argument
root@server:~ # mount -t msdosfs /dev/nda0p1 /boot/efi
mount_msdosfs: /dev/nda0p1: Operation not permitted
 
There was a bug in the installer that would never write the efi boot code on the second disk of a mirrored installation. Just newfs_msdos(8) it, and set up the same directory structure.

Would a dd command be sufficient for this? Like # dd if=/dev/nda0p1 of=/dev/nda1p1 or would I need to actually set it up by hand? I'll need to do this again on a server with 6 bootable disks later when I get home so that would be more expedient for me.
 
… Use freebsd-update fetch install

I had the same habit (a single command), can't recall where it was learnt, I'll no longer promote it.

Probably better to run two separate commands, as shown in installation files.

 
I had the same habit (a single command), can't recall where it was learnt, I'll no longer promote it.

Probably better to run two separate commands, as shown in installation files.


I always assumed putting multiple freebsd-update commands in a row are just executed in order the same way as if issued one by one...

So what exactly is the difference between invoking freebsd-update fetch && freebsd-update install and freebsd-update fetch install and would't that be a violation of POLA?
 
I always assumed putting multiple freebsd-update commands in a row are just executed in order …

I had the same assumption.

From the first screenshot, I no longer assume that there will be execution of all commands.

… POLA?

freebsd-update(8) COMMANDS:
  • does allow for install preceded by fetch in the same invocation
  • does not guarantee that both will succeed
– the user should not subsequently 'blindly' proceed as if there was success.
 
I had the same assumption.

From the first screenshot, I no longer assume that there will be execution of all commands.

Seems a big assumption from one instance. Perhaps there's another explanation?

freebsd-update(8) COMMANDS:
  • does allow for install preceded by fetch in the same invocation
  • does not guarantee that both will succeed
– the user should not subsequently 'blindly' proceed as if there was success

Well, no. If in a script one should test return code before proceeding, whether one or more commands issued.

Have you run this by the author of freebsd-update, cperciva@?

It would be a bug for freebsd-update to continue with further command/s after any failure.
 
/usr/sbin/freebsd-update
Code:
parse_cmdline () {
        while [ $# -gt 0 ]; do
                case "$1" in
                # Commands
                cron | fetch | upgrade | updatesready | install | rollback |\
                IDS | showconfig)
                        COMMANDS="${COMMANDS} $1"
                        ;;
                esac
                shift
        done
Code:
get_params $@
for COMMAND in ${COMMANDS}; do
        cmd_${COMMAND}
done
Simply execute them in order.
 
Code:
get_params $@
for COMMAND in ${COMMANDS}; do
        cmd_${COMMAND}
done

No error check, not there anyway. So, digging deeper:

See cmd_fetch(), cmd_install() etc ... these do 'exit 1' on error, or 'exit 2' where no updates are available, [edit] and of course 'exit 0' for good completions. 'exit 0' for completions, or just an implicit return for no error.

There's also code preventing running 'fetch' non-interactively instead of 'cron'.

But Colin might have an obvious answer to what Graham has observed ... ?
 
OK, so the code executes the same as if invoked as 2 separate commands.
of course I was assuming that one checks the output - regardless if invoked one by one or combined. So in essence, there's nothing wrong with freebsd-update here, it's just a matter of "don't ignore what the program is telling you"?
 
OK, so the code executes the same as if invoked as 2 separate commands.

Seems that way, but I'm trying to avoid assumptions, given its log of bugs over time.

of course I was assuming that one checks the output - regardless if invoked one by one or combined.
So in essence, there's nothing wrong with freebsd-update here, it's just a matter of "don't ignore what the program is telling you"?

Hopefully. It's a big program; clearly written but a lot to take in quickly, for bears of little brain like me, without time to chase all the rabbit holes ...

Reason I posted really was to suggest not rushing to change the documentation to fit a real or perceived bug in behavior.
 
Without me looking at code,

… in essence, there's nothing wrong with freebsd-update here, it's just a matter of "don't ignore what the program is telling you"?

that was my assumption.

More specifically: there's a warning, so a stop is sensible (allow the user to observe the warning).
 
Back
Top