ZFS Easier way to switch between two os on the same zpool?

Hi everyone,

I have a ZFS pool with two datasets: one contains fb15 and the other contains fb16. Currently, if I want to boot into a different system, I have to boot from a Live CD, then manually set the mountpoint and the bootfs property to point to the desired dataset. This works, but it's quite cumbersome.

Is there a way to switch between these two datasets directly from the currently running system (without rebooting into a Live CD)? Ideally, I'd like to be able to set the boot environment and reboot normally, perhaps by modifying some bootloader configuration or using a ZFS command.

Any advice would be greatly appreciated!

Thanks!
 
Are both actually Boot Environments? "bectl list" to see if they are.
If so then you simply use "bectl activate".
I'm assuming you installed fb15 and simply used the defaults in the installer. If so that gives you fb15 in a BE.
Then the question would be how did you create the fb16 environment?

If you start with posting the output of bectl list, then we can help make sure.
If everything is boot environments:
If you are in the fb15 BE, then "bectl activate fb16 && reboot" to wind up in the fb16 BE. To flip back to fb15, bectl activate fb15 && reboot.
 
Are both actually Boot Environments? "bectl list" to see if they are.
If so then you simply use "bectl activate".
I'm assuming you installed fb15 and simply used the defaults in the installer. If so that gives you fb15 in a BE.
Then the question would be how did you create the fb16 environment?

If you start with posting the output of bectl list, then we can help make sure.
If everything is boot environments:
If you are in the fb15 BE, then "bectl activate fb16 && reboot" to wind up in the fb16 BE. To flip back to fb15, bectl activate fb15 && reboot.
bectl list only one BE.
I created a zroot/fb15 database for fb15 and copied files into it.
Then I zpool set bootfs=zroot/fb15 zroot, then I can enter the fb15 after rebooting. If I zpool set bootfs=zroot/ROOT/default zroot and reboot, I can enter the fb16.
1000065146.jpg
 
Ok. So you have a single BE named default; it sounds like that is a fb16 system. (freebsd-version -kru will tell us)
Then you manually created fb15 (zfs create zroot/fb15 and copied fb15 files into it)?
That means that fb15 is not a BE which is why it does not show up under bectl list. That means you can't use bectl activate.

Your zpool set bootfs commands I think are the only way to get what you want, but I don't think you need to stop in the livecd todo that.
If you are in fb16 you should be able to do set bootfs to the fb15 and reboot into the fb15. Same thing if you are in fb15 and want to reboot into fb16.

I don't know if you can "promote" the fb15 dataset into a BE (boot environments are technically "clones" under the hood which are writable snapshots) or how to unwind it by "bectl create" a new fb15 BE and modify that.

If you search the forum for "zfs upgrade into a new BE" you should find some info from vermaden and from me but that talks about upgrading into a new BE (like currently running 14.x and doing freebsd-upgrade across major release to 15.x). Can you go backwards from 16.x to 15.x? I have no idea.
 
Back
Top