Solved FreeBSD 13.1 Upgrade Issue

I first want to apologize if the formatting or lack there of is bad. But I’m stuck using a phone to type this.

I have never had a previous issue upgrading FreeBSD. I used a simple:

freebsd-update upgrade -r 13.1-RELEASE

It did the normal things. It merged in 2 new users and a minor ssh configuration.

Then I ran:

freebsd-update install

It said to reboot and run install again

This is where it had an issue. On reboot the screen shows:

ZFS: unsupported compression algorithm 16
ZFS: I/o error - all block copies unavailable
Invalid format

Then I get a prompt:

FreeBSD/x86 boot
Default: zroot/ROOT/13.0-RELEASE:/boot/kernel/kernel
boot:

?

Does appear to show some of my files. Not sure what happened or best steps forward.
 
Looks like I may be close to solving it myself. I downloaded the img file. Booted that up and went to the shell and re-wrote the:

gpart bootcode-b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

And now I’m on to the second freebsd-update install.
 
When you say downloaded the img do you mean the install iso? Tried the upgrade tonight and ended up at the exact spot as you
 
Okay, thank you for the help that fixed it for me as well.
For anyone else hitting this issue, here's the complete steps I did:
Downloaded the memstick .img file for FreeBSD 13.1
Wrote that to a USB stick on another machine with dd bs=4M if=/path/to/FreeBSD13.1.img of=/dev/sdb <--replace with your USB stick device) (note I did this part on a Linux desktop I was using)
Booted the FreeBSD machine that was broken to the USB stick, selected Live CD on the boot options that pop up.
Then used the above command (with corrected space typo):
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
and as I have a zfs mirror for boot, I also did
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
Rebooted, removed USB stick, and it booted up normally. Did the second freebsd-update install at that point.

I wonder if this is a more widespread issue or if you and I have some weird configuration?
 
Okay, thank you for the help that fixed it for me as well.
For anyone else hitting this issue, here's the complete steps I did:
Downloaded the memstick .img file for FreeBSD 13.1
Wrote that to a USB stick on another machine with dd bs=4M if=/path/to/FreeBSD13.1.img of=/dev/sdb <--replace with your USB stick device) (note I did this part on a Linux desktop I was using)
Booted the FreeBSD machine that was broken to the USB stick, selected Live CD on the boot options that pop up.
Then used the above command (with corrected space typo):
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
and as I have a zfs mirror for boot, I also did
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
Rebooted, removed USB stick, and it booted up normally. Did the second freebsd-update install at that point.

I wonder if this is a more widespread issue or if you and I have some weird configuration?
Glad you figured it out. I couldn’t get on earlier to reply. But I suppose it wouldn’t matter which way you want to boot as long as you have supporting hardware. Like a dvd drive. I just go with the usb because it is easier.

I can’t for the life of me remember if I somehow didn’t rewrite the boot when I upgraded from 12 to 13. I think I would have. But the issue had me questioning it.
 
I don't remember having to rewrite the boot stuff... There was nothing in the upgrade docs or freebsd-update output suggesting that would be needed so I wouldn't think so. It's not something I would just go and do, I don't think
 
I just got bit by this myself. I saw nothing in the release docs about needing to update the boot blocks.
Sure would have been nice.
I'm glad everyone was able to unbork their boot drives.
Always take a boot environment snapshot before upgrading! man bectl.
 
Summary:

Running/experimenting an old i386, I ran into the same issue when upgrading, I believe originally from 11ish to 13.0 skipping some minor/major versions (ROOT pool below). In the temporary system I tried many things; installed as 12.4, then upgraded to 13.0 and then to 13.2. This worked & booted OK. While trying, I upraded the ROOT pool system (I believe from 13.0) to 13.2. No avail. See details below.

Bottom line: /var/run/os-version was left to 13.0 and /boot/kernel was not updated for some files, especially zfs.ko, in the ROOT pool compared to the temp system. After rsyncing from temp to the ROOT pool, it finally booted OK!


Some of the time line below (file paths not explicitly consistent).


I got the boot menu and forward from there with the respective from above:

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0

I took the pmbr and gptzfsboot from 13.2-i386-memstick.img OK.

However, I'm stuck in the boot mount prompt (dispite chatgpt 4 dialogue).

I suspects it's the zstd been upgarded to my ROOT pool. So, not recomending it.

  • load zfs gives Uknown file system
  • pointing a lá zfs:pool/ROOT/default with 2 different syntaxes gives the same error.
  • freebsd-update rollback didn't help.

I tested by installing a 12.4 and the upgrading it to 13.0 and then to 13.2. With it, I am able to import my ROOT pool, but not boot from it. But from this test pool, I am able to boot OK.

  • freebsd-update -r 13.2-RELEASE upgrade install
  • reboot
  • freebsd-update install
  • pkg bootstrap -f
  • pkg upgrade
  • freebsd-update install

The ROOT pool seems to have some discrepancy in kernel vesion (pkg bootstrap -f):
# chroot /mnt/ /usr/bin/env -i TERM=$TERM /usr/local/bin/bash

# sysctl -a | grep osrel
kern.osrelease: 13.2-RELEASE-p4
kern.osreldate: 1302001
kern.disallow_high_osrel: 0
security.jail.param.osrelease: 32
security.jail.param.osreldate: 0

# freebsd-version -k; uname -r
13.2-RELEASE-p4
13.2-RELEASE-p4

# pkg bootstrap -f -> OK DONE

# pkg update -> DONE / None

# pkg upgrade -> DONE /None

# pkg bootstrap -f -> RUN ONCE OK.

# pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:i386/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.20.8...
Newer FreeBSD version for package pkg:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1302001
- running kernel: 1300139
Ignore the mismatch and continue? [y/N]: ^C


# cat /etc/os-release
NAME=FreeBSD
VERSION=13.0-RELEASE-p11
VERSION_ID=13.0
ID=freebsd
ANSI_COLOR="0;31"
PRETTY_NAME="FreeBSD 13.0-RELEASE-p11"
CPE_NAME=cpe:/o:freebsd:freebsd:13.0
HOME_URL=https://FreeBSD.org/
BUG_REPORT_URL=https://bugs.FreeBSD.org/

After chatgpt, I noticed:

diff /boot/kernel /mnt/boot/kernel |less
Binary files /boot/kernel/dtrace.ko and /mnt/boot/kernel/dtrace.ko differ
Binary files /boot/kernel/fasttrap.ko and /mnt/boot/kernel/fasttrap.ko differ
Binary files /boot/kernel/mps.ko and /mnt/boot/kernel/mps.ko differ
Binary files /boot/kernel/mpt.ko and /mnt/boot/kernel/mpt.ko differ
Binary files /boot/kernel/zfs.ko and /mnt/boot/kernel/zfs.ko differ
Binary files /boot/kernel/zlib.ko and /mnt/boot/kernel/zlib.ko differ

Then I run (some files from above updated on previous execution):
# rsync -Hav --info=progress2 /boot/kernel/ /mnt/boot/kernel/ -c
sending incremental file list
./
mps.ko
218,956 0% 35.51MB/s 0:00:00 (xfr#1, to-chk=336/840)
mpt.ko
384,356 0% 25.79MB/s 0:00:00 (xfr#2, to-chk=335/840)
zfs.ko
4,009,940 2% 38.31MB/s 0:00:00 (xfr#3, to-chk=1/840)
zlib.ko
4,087,408 2% 35.80MB/s 0:00:00 (xfr#4, to-chk=0/840)

sent 4,124,391 bytes received 1,330 bytes 1,178,777.43 bytes/sec
total size is 139,805,872 speedup is 33.89

It works! /boot/kernel was not updated!
 
Back
Top