Bug 256252 - freebsd-update rollback made system unbootable
Summary: freebsd-update rollback made system unbootable
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-30 03:10 UTC by Bert JW Regeer
Modified: 2021-06-05 19:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bert JW Regeer 2021-05-30 03:10:00 UTC
I am running with ZFS on root using a default install that was made using FreeBSD 12.0-RELEASE a year or two ago.

Today I attempted to upgrade to FreeBSD 13.0-RELEASE, after rebooting into the new kernel network traffic stopped working, so I wanted to roll back the changes FreeBSD update had made:

freebsd-update rollback
shutdown -r now

However after that I got back a mountroot>

After some fiddling, I used the following to get back into a bootable state:

set currdev="zfs:zroot/ROOT/default:"
unload
load /boot/kernel.old/kernel
load /boot/kernel.old/opensolaris.ko
load /boot/kernel.old/zfs.ko
boot -s

Once in single user mode:

zfs set readonly=off zroot
zfs mount -a
cd /boot
cp -pr kernel kernel.13
cp -pr kernel.old kernel.12
rm -rf kernel
cp -pr kernel.old kernel

shutdown -r now

After that my system came back online.

When I attempted to load:

/boot/kernel/kernel at the loader it would succeed, but would fail when I attempted to load /boot/kernel/opensolaris.ko.

Somehow a freebsd-update rollback left me with a broken /boot/kernel.

The upgrade was from FreeBSD 12.2-RELEASE-p5 to FreeBSD 13.0-RELEASE-p1.

root@Breached:/usr/home/xistence # zpool status
  pool: zroot
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
	still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
	the pool may no longer be accessible by software that does not support
	the features. See zpool-features(7) for details.
  scan: none requested
config:

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

errors: No known data errors
root@Breached:/usr/home/xistence # zfs list -t all
NAME                 USED  AVAIL  REFER  MOUNTPOINT
zroot               7.66G   202G    88K  /zroot
zroot/ROOT          6.10G   202G    88K  none
zroot/ROOT/default  6.10G   202G  6.10G  /
zroot/tmp            112K   202G   112K  /tmp
zroot/usr           1.44G   202G    88K  /usr
zroot/usr/home      28.8M   202G  28.8M  /usr/home
zroot/usr/ports      713M   202G   713M  /usr/ports
zroot/usr/src        733M   202G   733M  /usr/src
zroot/var            123M   202G    88K  /var
zroot/var/audit       88K   202G    88K  /var/audit
zroot/var/crash       88K   202G    88K  /var/crash
zroot/var/log        123M   202G   123M  /var/log
zroot/var/mail       104K   202G   104K  /var/mail
zroot/var/tmp        124K   202G   124K  /var/tmp

Nothing special here. Let me know if there is anything else I can help with.
Comment 1 Graham Perrin 2021-06-05 16:16:57 UTC
> … from FreeBSD 12.2-RELEASE-p5 to FreeBSD 13.0-RELEASE-p1 …

Please, how exactly did you perform the upgrade? 

Was chroot involved?
Comment 2 Bert JW Regeer 2021-06-05 19:56:53 UTC
No chroot involved.

Just as root:

freebsd-update update -r 13.0-RELEASE
freebsd-update install
reboot
# system fails to bring network up
freebsd-update rollback
reboot
# failed to boot