Solved failed to upgrade 12.2 to 13.0

Hi.

I'm on root-on-zfs, on raidz1.
Tried to make
Code:
freebsd-update -r 13.0-RELEASE upgrade
freebsd-update install

This give me:
img-2022-01-07-10-40-09.png


Rebooted to kernel.old, tied to make
Code:
freebsd-update rollback
This give me:
img-2022-01-07-10-52-09.png



Wtf?
 
Drop to the loader prompt from the menu. Then follow these:
Code:
unload
load /boot/kernel.old/kernel
load /boot/kernel.old/opensolaris.ko
load /boot/kernel.old/zfs.ko
boot

After the system booted we can check for the /usr/ filesystem. Looks like it might be in fstab, it shouldn't be there.
 
Drop to the loader prompt from the menu. Then follow these:
Code:
unload
load /boot/kernel.old/kernel
load /boot/kernel.old/opensolaris.ko
load /boot/kernel.old/zfs.ko
boot

After the system booted we can check for the /usr/ filesystem. Looks like it might be in fstab, it shouldn't be there.

Thanks.

I booted kernel.old normally, and reverted root to pre-update snapshot, now all works fine.

But. It seems freebsd-update have broken upgrade 12.2->13. As i investigated location of zpool.cache changed and it not imports all zpools after booting new kernal.

And, what is more frustrating, freebsd-update have broken rollback mechanism. It seems to only roll back the kernel itself, but not modules.
 
As i investigated location of zpool.cache changed and it not imports all zpools after booting new kernal.
13 doesn't have automatic import any more, it's now handled by an init-script. Probably, your upgrade isn't complete (did you execute it 3 times?)
And, what is more frustrating, freebsd-update have broken rollback mechanism.
Such a mechanism can never be complete. You're on ZFS, use boot environments!
 
It seems freebsd-update have broken upgrade 12.2->13.
No, it just seems to have failed for you. I have upgraded many systems from 12.2 to 13.0 and didn't have any problems.

As i investigated location of zpool.cache changed and it not imports all zpools after booting new kernal.
Keep in mind that 13.0 uses the new OpenZFS, which is slightly different from the ZFS that came with FreeBSD before. Things work a little different behind the scenes.
 
No, it just seems to have failed for you. I have upgraded many systems from 12.2 to 13.0 and didn't have any problems.
This means it not fully-broken. But it broken for some configurations.

Keep in mind that 13.0 uses the new OpenZFS, which is slightly different from the ZFS that came with FreeBSD before. Things work a little different behind the scenes.
I know. But it imports root pool normally. I thinks this causes problem:

Code:
[me at myhost:~/freebsd/git/src]{main}$ git log -U -1 --grep zpool.cache
commit a784185078e566103b7f8abffc7c0a4a1e813eb1
Author: Cy Schubert <cy at FreeBSD.org>
Date:   Thu Aug 27 14:33:46 2020 +0000

     /etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
     Check for it first. Only use /boot/zfs/zpool.cache if the /etc/zfs
     version is not found and good.

     Reported by:    avg
     Suggested by:   avg, kevans

Notes:
     svn path=/head/; revision=364867

And freebsd-update have not workaround for this.
 
No, that's NOT the reason. Importing pools is now handled by the init-script (IIRC /etc/rc.d/zfs), only the root pool is imported automatically. You didn't upgrade your init scripts.
 
No, that's NOT the reason. Importing pools is now handled by the init-script (IIRC /etc/rc.d/zfs), only the root pool is imported automatically. You didn't upgrade your init scripts.
Okay. Normal freebsd-update process is: download update, install kernel, reboot, update userland(init scripts).

It breaks down on reboot. How can i upgrade init scripts using normal freebsd-update process?

And nothing in relnotes about it.
 
As you've only done the first freebsd-update install, only the kernel is updated. The userland (including the rc.d scripts) are done on the second invocation of freebsd-update install.

Anyway, fix this mess, I assume you managed to boot your old 12.2 kernel?
Code:
rm -rf /boot/kernel
mv /boot/kernel.old /boot/kernel
That will restore the old 12.2 kernel. And I would suggest starting the upgrade from scratch. Follow these:
  • rm -rf /var/db/freebsd-update/* Clean out the update files.
  • freebsd-update -r 13.0-RELEASE upgrade
  • Remove any and all kernel modules you don't strictly need to boot the system from loader.conf and/or rc.conf. This is just temporarily, it removes various potential issues.
  • Disable any services that might start at boot, again, this is just temporary. Disable everything you don't strictly need to boot the system.
  • Run freebsd-update install, freebsd-update install. Yes, that's not an error, run it twice. Do NOT reboot after the first install.
  • Double check everything not strictly required is disabled.
  • reboot
  • Update your ports/packages. Everything must be reinstalled!
  • Run the final freebsd-update install
  • Reboot
  • Enable all the services and modules again.
 
Back
Top