Solved Cannot boot after renaming zfs pool

I am running 14.0-RELEASE-p3.
I have tried to rename my pool from "root" to "zroot".
Therefore I booted from a 14.0 memstick and executed the following:
zpool import root zroot
zpool export zroot
I also added vfs.root.mountfrom=zroot to loader.conf.
Now boot failed with error "invalid filesystem specification".
When I booted from the stick, i could not import zroot and received the error "pool exists more then one time".
So i named the pool back to "root", despite the fact that there is no other pool.
Now i can easily mount the pool when booting from usb, but my original system still fails with "invalid filesystem specification".

Any ideas how I can fix/debug this?
 
[...] I have tried to rename my pool from "root" to "zroot".
Therefore I booted from a 14.0 memstick and executed the following:
zpool import root zroot
zpool export zroot
I also added vfs.root.mountfrom=zroot to loader.conf.
Renaming a ZFS root pool is a rather delicate operation because, first of all, it concerns the renaming of a boot device. This is the device on which you are normally running your OS on and then in a mounted state, of course. Secondly, a ZFS boot device has somewhat special properties compared to a normal filesystem, like UFS. A ZFS pool can have multiple root filesystems for example.

I cannot follow every step and subsequent consequences from the reported actions you've taken, but I suggest the following for consideration.

Using zpool import -R /mnt pool_id zroot is generally a better/safer way to begin your rootpool renaming steps.

I would refrain from using vfs.root.mountfrom in loader.conf at all. Using this property has a rather long history from past habits:
Warner Losch - Sat, 27 Aug 2022 04:15:55 UTC in Re: ZFS bootfs vs vfs.root.mountfrom
[setting vfs.root.mountfrom in /boot/loader.conf] really never had been the proper way. One should almost never do it today, except in the above 'special snowflake' systems [...]

In this mailing list thread the wiki is also being referred to:
Boot Environments - FreeBSD wiki:
Setting Boot Dataset

In order for boot environments to be effective, you must let the bootfs zpool property control which dataset gets mounted as the root. Particularly, /etc/fstab must be purged of any / mount, and /boot/loader.conf must not be setting vfs.root.mountfrom directly.
 
Back
Top