Please help me understand boot environments

Started by Vexz, August 10, 2022, 08:26:38 AM

Previous topic - Next topic
It looks like the system doesn't use much of ZFS, it only formats the drive and that's it? It doesn't even set trimming:o

Is there any 'solution' to boot environments published?
Running CLI commands isn't useful, you will not have access to CLI once you need the snapshot, obviously. Same with the snapshot creation, you will not have it, because it's not hooked up to pkg updates or you simply forget.

So I think about install hook + boot menu restore as a very first step.

① Install hook can be anything slapped into rc.syshook.d/upgrade folder I guess. Easy but also needs maintenance and bectl doesn't offer any rules like number of snapshot clones (something like zfs set snapshot_count=5).

② I didn't notice this in the boot menu:

I create a BE before every major update. I have never had an update lock me out of SSH, so I could always roll back if anything wasn't working.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on December 16, 2023, 05:36:09 PM
I create a BE before every major update. I have never had an update lock me out of SSH, so I could always roll back if anything wasn't working.
I could not, but good for you. Boot selection would be the perfect solution if not the whole point of BE. If it works, it makes sense to scripts some hooks👍The question remains, can it be turned on? I've searched for another hour without success.

Quote from: 36thchamber on December 16, 2023, 09:59:57 PM
I could not, but good for you.
What's keeping you from making bectl create before-upgrade-20231216 a regular part of your update routine? That's all it takes. You can always boot into that snapshot via the console menu afterwards. What you found in the boot menu does work. You need physical or at least remote serial or remote KVM access to use that, of course.

There's one active and by default also active at the next reboot BE at all times. The OPNsense system does not really care about that - I get your point. But you can really just bectl create ... before every update and then the state before the update will be available via the FreeBSD boot menu. It cannot get much simpler apart from the fact that you need to use the CLI.

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Maybe I don't understand the problem, but I am doing the same as Patrick before every update and I am able to go back all the times using CLI.
However, local snapshots/BE can never be used when system is no longer reachable by any ways, for sure.
For such cases I export those BE using bemanager and I am able to restore within a few minutes. Did this a few weeks ago when I changed hardware... I simply had to install fresh sense, activate SSH, install bemanager and import BE. As I remember this all took just a little longer than a cigarette..
i am not an expert... just trying to help...

Quote from: Patrick M. Hausen on December 16, 2023, 10:22:28 PM
What's keeping you from making bectl create before-upgrade-20231216 a regular part of your update routine? That's all it takes.
so the answer to that question is yes, that's what I wanted to double check. It's only visible when multiple snapshots exist as i couldn't see it. Now it's time to create a hook. I would not run it manually because that's should be hooked to installation as on every other OS. Meanwhile, i created automatic ZFS handling. ZFS was just balooning in size, without snapshots, which is a waste of space. Now it does snapshotting daily/hourly, cleanup and emergency cleanup. That's because ZFS soon took 100% of the harddrive despite zfs snapshout_limit & zpool feature@filesystem_limits=active, rendering OS frozen very quick in the process. Luckily it's without its famous bugs like 'pool can't operate when full', and it didn't kernel panic yet. It's just producing some silent errors which it can't autoheal like it never could. Let's see how long it will last. Defly one of my least favorite fs, but better than UFS with PHP:)