Bug 256252 - freebsd-update rollback made system unbootable
Summary: freebsd-update rollback made system unbootable
Status: Open
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 Delta Regeer
Modified: 2023-10-23 16:43 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Delta 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 freebsd_committer freebsd_triage 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 Delta 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
Comment 3 Ed Maste freebsd_committer freebsd_triage 2023-10-22 18:30:00 UTC
Have you (or anyone else) successfully used `freebsd-update rollback` to rollback to a previous major version? I am trying to figure out if this is a regression, or if freebsd-update has just never supported this.
Comment 4 Delta Regeer 2023-10-23 16:43:34 UTC
Ed Maste:

I have yet to have freebsd-update rollback actually work correctly on systems that doesn't have boot environments enabled.

This is mostly older systems where that was part of the default install.

For newer installations I have not yet had to use freebsd-update rollback because everything just worked.