Solved using beadm to create and manage several boot environments

tOsYZYny

Member

Reaction score: 4
Messages: 84

I used beadm to create several boot environments as I configured my system. I configured my system using a set of shell scripts which includes installing packages, adding users, generating configuration files, configuring /boot/loader.conf, /etc/rc.conf, etc.

What I want to do is to update my system using my shell scripts (I maintain my system configuration in a git repository). I am thinking that I will boot to my original boot environment, create (and activate) a new boot environment. Then, I will proceed as if I were configuring my system for the first time (add packages, /boot/loader.conf, /etc/rc.conf ...).

I used a standard ZFS layout with GELI.

Will I be able to revert back to my original boot environments should anything go wrong? Or, do I need to partition my system differently?

My ZFS layout is:
Code:
/tmp
/var/mail
/usr/home
/usr/ports
/var/crash
/var/tmp
/usr/src
/var/audit
/var/log
/
 

unitrunker

Well-Known Member

Reaction score: 197
Messages: 498

The best way to answer this question is to do a simple test. Create new BE (using bectl or beadm), activate the BE, and reboot. Make trivial edit to a config file (add a comment to loader.conf). Now reactivate the prior BE and reboot.

Is the comment still there?
 
OP
T

tOsYZYny

Member

Reaction score: 4
Messages: 84

Thanks - I just tested this and it works as I would expect provided the changes I make are on the ROOT FS. By default, the auto ZFS install sets up all those other filesystems. If I were to change any one of those, then it doesn't register that change. I think that is ideal because I shouldn't be including logs or my home directory in the main system configuration.

So, if I want to "fork" from snapshot 3 because all everything from then on is foo-barred, then, I activate be 3, create and activate a new boot environment and then continue from there.
 
Top