Solved FreeBSD Upgrade from 13.2 to 13.3 "cannot import 'zroot': pool already exists"

Hiho,
I've (tried to) upgrade(d) a machine running ZFS on root from 13.2 to 13.3.. But after reboot I am stuck with "cannot import 'zroot': pool already exists" and hence booting hangs with "Loading kernel modules:". When using kernal.old on boot, the machine starts up fine (albeit with 13.2 still). (Before upgrade I've made a zroot snapshot, if that's of help).
Any tips? :)

best regards
 
> Did you perform the update before the upgrade?

Indeed not. Pkg displayed the version mismatch message - should've made me suspicious.

Booting with old kernel worked and I had an incomplete update "update pendig", which I fixed. Afterwards I re-did the upgrade to 13.3 (incl pkg upgrade before). But now there is only default kernel on boot and booting hangs with "module kernel exists but in wrong version". Multi-User and Single-User both hang with this message.

I then used an older boot environment, which booted find and re-did the update steps - but the result is the same "module kernel exists but in wrong version".

I am a bit lost :)
 
Thanks,

… I re-did the upgrade to 13.3 (incl pkg upgrade before) …

I didn't mean pkg to upgrade ports.

1720895200855.png
I meant the update to the OS that should precede an upgrade to the OS:
 
> I meant the update to the OS that should precede an upgrade to the OS:

yes, I did that before # freebsd-update upgrade -r 13.3-RELEASE

Just curious: as I have a working older boot environment (13.2), I booted and did some zfs rollback


zfs rollback zroot/var@13.2
zfs rollback zroot/ROOT/default@13.2
zfs rollback zroot/ROOT@13.2
zfs rollback zroot@13.2
shutdown -r now


after rollback booting still hangs... mkahay. But as I have a working older boot environment: what is the proper way to fix things? I already tried freebsd-update fetch/install but same same.
 
In loader.conf i have:
Code:
currdev="zfs:ZT2/ROOT/default:"
vfs.root.mountfrom="zfs:ZT2/ROOT/default"
zfs_load="YES"

Try also "mount -a" in single user mode to check if there is no error in /etc/fstab.

In fstab i have:
Code:
ZT2/ROOT/default           /       zfs    rw    0    0
 
13.2-RELEASE-p12_2024-07-12_204416 ist the old and working be, which I also used to run bectl
Code:
bectl list -c creation -s
BE/Dataset/Snapshot                             Active Mountpoint Space Created

default
  zroot/ROOT/default                            R      -          102G  2023-03-15 19:50
  default@migrate                               -      -          5.85G 2023-03-15 20:32
  default@2023-05-17-22:38:53-0                 -      -          124M  2023-05-17 22:38
  default@2023-05-17-22:41:41-0                 -      -          3.78M 2023-05-17 22:41
  default@2023-07-21-20:21:28-0                 -      -          3.95G 2023-07-21 20:21
  default@2023-10-11-21:43:30-0                 -      -          3.41G 2023-10-11 21:43
  default@2023-12-09-18:39:36-0                 -      -          2.89G 2023-12-09 18:39
  default@2024-01-28-19:26:19-0                 -      -          1.58G 2024-01-28 19:26
  default@2024-03-10-20:36:37-0                 -      -          3.20G 2024-03-10 20:36
  default@2024-04-21-21:23:49-0                 -      -          3.49G 2024-04-21 21:23
  default@2024-07-12-19:32:43-0                 -      -          2.64M 2024-07-12 19:32
  default@13.2                                  -      -          912K  2024-07-12 19:58
  default@2024-07-12-20:44:16-0                 -      -          3.23M 2024-07-12 20:44

13.1-RELEASE-p7_2023-05-17_223853
  zroot/ROOT/13.1-RELEASE-p7_2023-05-17_223853  -      -          8K    2023-05-17 22:38
    zroot/ROOT/default@2023-05-17-22:38:53-0    -      -          124M  2023-05-17 22:38
  13.1-RELEASE-p7_2023-05-17_223853@13.2        -      -          0     2024-07-12 19:58

13.2-RELEASE_2023-05-17_224141
  zroot/ROOT/13.2-RELEASE_2023-05-17_224141     -      -          8K    2023-05-17 22:41
    zroot/ROOT/default@2023-05-17-22:41:41-0    -      -          3.78M 2023-05-17 22:41
  13.2-RELEASE_2023-05-17_224141@13.2           -      -          0     2024-07-12 19:58

13.2-RELEASE_2023-07-21_202128
  zroot/ROOT/13.2-RELEASE_2023-07-21_202128     -      -          8K    2023-07-21 20:21
    zroot/ROOT/default@2023-07-21-20:21:28-0    -      -          3.95G 2023-07-21 20:21
  13.2-RELEASE_2023-07-21_202128@13.2           -      -          0     2024-07-12 19:58

13.2-RELEASE-p1_2023-10-11_214330
  zroot/ROOT/13.2-RELEASE-p1_2023-10-11_214330  -      -          8K    2023-10-11 21:43
    zroot/ROOT/default@2023-10-11-21:43:30-0    -      -          3.41G 2023-10-11 21:43
  13.2-RELEASE-p1_2023-10-11_214330@13.2        -      -          0     2024-07-12 19:58

13.2-RELEASE-p4_2023-12-09_183936
  zroot/ROOT/13.2-RELEASE-p4_2023-12-09_183936  -      -          8K    2023-12-09 18:39
    zroot/ROOT/default@2023-12-09-18:39:36-0    -      -          2.89G 2023-12-09 18:39
  13.2-RELEASE-p4_2023-12-09_183936@13.2        -      -          0     2024-07-12 19:58

13.2-RELEASE-p7_2024-01-28_192619
  zroot/ROOT/13.2-RELEASE-p7_2024-01-28_192619  -      -          8K    2024-01-28 19:26
    zroot/ROOT/default@2024-01-28-19:26:19-0    -      -          1.58G 2024-01-28 19:26
  13.2-RELEASE-p7_2024-01-28_192619@13.2        -      -          0     2024-07-12 19:58

13.2-RELEASE-p9_2024-03-10_203637
  zroot/ROOT/13.2-RELEASE-p9_2024-03-10_203637  -      -          8K    2024-03-10 20:36
    zroot/ROOT/default@2024-03-10-20:36:37-0    -      -          3.20G 2024-03-10 20:36
  13.2-RELEASE-p9_2024-03-10_203637@13.2        -      -          0     2024-07-12 19:58

13.2-RELEASE-p10_2024-04-21_212349
  zroot/ROOT/13.2-RELEASE-p10_2024-04-21_212349 -      -          8K    2024-04-21 21:23
    zroot/ROOT/default@2024-04-21-21:23:49-0    -      -          3.49G 2024-04-21 21:23
  13.2-RELEASE-p10_2024-04-21_212349@13.2       -      -          0     2024-07-12 19:58

13.2-RELEASE-p11_2024-07-12_193243
  zroot/ROOT/13.2-RELEASE-p11_2024-07-12_193243 -      -          960K  2024-07-12 19:32
    zroot/ROOT/default@2024-07-12-19:32:43-0    -      -          2.64M 2024-07-12 19:32
  13.2-RELEASE-p11_2024-07-12_193243@13.2       -      -          8K    2024-07-12 19:58

13.2-RELEASE-p12_2024-07-12_204416
  zroot/ROOT/13.2-RELEASE-p12_2024-07-12_204416 N      /          1.20M 2024-07-12 20:44
    zroot/ROOT/default@2024-07-12-20:44:16-0    -      -          3.23M 2024-07-12 20:44

/boot/loader.com
Code:
aesni_load="YES"
geom_eli_load="YES"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
opensolaris_load="YES"
zfs_load="YES"
# gpu
#hw.syscons.disable=1
# Added by auto-admin from desktop-installer
uplcom_load="YES"
# End auto-admin addition
# Added by auto-admin from desktop-installer
ng_ubt_load="YES"
# End auto-admin addition


WIN_20240715_191604.JPG
 
I read a bit about boot-environments and actually I am afraid to break more things by fiddling around. But would be mounting the currently non-working default boot-environment and performing the upgrade steps worth a try?

Code:
bectl mount default /mnt
freebsd-update upgrade -b /mnt -d /mnt/var/db/freebsd-update --currently-running 13.2-RELEASE -r 13.3-RELEASE
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install

followed by reboot and a pkg ugrade?

Or is this the wrong approach?
 
Not necessarily wrong, but if you can confirm the 13.2-RELEASE-p12_2024-07-12_204416 BE does indeed have no obvious issues, I'd rather boot into that and start from there:
bectl create new_world
bectl mount new_world /mnt

And after that the freebsd-update invocations you mentioned. (Of course, you can choose any name you like...)

That way you'd start from a presumably sane state, and also have the faulty BE still around in case you'd want to try to figure out what went wrong before. Once you're sufficiently confident everything went well, you can start cleaning out the obsolete BEs.
 
Yeah, back on track! Thanks to everyone for helping! :)

For the record:
I booted into a know good old boot environment 13.2-RELEASE-p12_2024-07-12_*
and issued the following commands:

# bectl create 13.2_upgrade
# bectl mount 13.2_upgrade /mnt
# freebsd-update upgrade -b /mnt -d /mnt/var/db/freebsd-update --currently-running 13.2-RELEASE -r 13.3-RELEASE
# freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
Installing updates...
# freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
Installing updates...
# freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
No Updates are available to install
# mount -t devfs devfs /mnt/dev # pkg needs devfs mounted
# pkg-static -c /mnt upgrade -f
# umount /mnt/dev
# bectl umount 13.2_upgrade
# bectl activate 13.2_upgrade
# shutdown -r now

Most propably the --currently-running argument could've been left out, but I included it anyways. And I removed the OpenSolaris-related line.

After reboot system comes up again and yes, it's 13.3-RELEASE:
# uname -a
FreeBSD $NAME 13.3-RELEASE-p3 FreeBSD 13.3-RELEASE-p3 GENERIC amd64


Thanks! :)

Edit: corrected parameter of # bectl umount
 
Back
Top