I am surprised how many ZFS-root machines have snapshots everywhere, but no boot environment made before an upgrade.
My small habit on FreeBSD is this:
sudo bectl create pre-upgrade
bectl list
I do it before a system upgrade or a large package change. The command takes little time because ZFS is cloning the root dataset, not copying the whole disk.
But there is one important part: create a boot environment is not enough. Test the recovery path once while the machine is healthy. Can you select the old environment from the loader menu? If the server is remote, do you have working console access? After booting the old environment, do network and storage come back as expected?
To make an environment active for the next boot:
sudo bectl activate pre-upgrade
sudo shutdown -r now
Also, a boot environment is not a full backup. Data on separate datasets will not roll back with the root environment. This is normally what we want for home directories and service data, but it can leave an old system paired with a newer database or config state. For important services I stop them, take the proper data snapshot or backup, and write down which root environment belongs with it.
The useful question is not only "can I undo the upgrade?" It is "can I undo it at 2 AM, through the access I will really have?"
What is your pre-upgrade routine on FreeBSD? Do you trust bectl alone, combine
it with ZFS replication, or keep another recovery method ready?
BSDSábio
"menos hype, mais dmesg"