clarification of snapshots

Started by tessus, January 17, 2026, 05:38:16 AM

Previous topic - Next topic
I've been using snapshots on Proxmox forever and I have been doing the same on other ZFS systems as well. I have read through the OPNsense snapshot documentation and a few things make no sense to me and I kindly ask you to clarify the situation for me.

When I installed OPNsense on new HW I used ZFS this time around and during the installation a "default" snapshot was created and has been used since.

So the documentation states that if I create a snapshot and make it active, it will be used on next boot (basically does a rollback to the time of the snapshot creation). But my "default" snapshot was created in September last year and when I reboot, it is not rolled back to September, but everything since then has been persisted and it is as if there is no snapshot at all.

So my understanding of snapshots is this: A snapshot is exactly what its name suggests - a snapshot at any point in time. When I rollback to the snapshot it starts at the time the snapshot was created.
In Proxmox I run a VM and by default there are no snapshots. Then I can create snapshots at any point in time and roll back to exactly that point. And I can go back to that point in time multiple times.

But here in OPNsense it persists data. My problem of understanding is why and when will a snapshot in OPNsense start to persist data? When I make it active for the first time? If so, this means I cannot use (rollback to) a snapshot more than once. e.g. how do I rollback to Sept. 2025 when the "default" snapshot was created?
Somehow there is a disconnect I cannot reconcile.

It would all make sense to me, if there was a "rollback" button for the active snapshot. Or is the "Activate" button the rollback button? So even though the "default" snapshot is currently active, I would have to activate it again to rollback to Sept. 2025?

You are right, it's an odd behavior given the name but most of all I think its naming is not correct.

The feature is based on 'bectl -- Utility to manage boot environments on ZFS', ZFS snapshots are use but the purpose is not for rollbacks but having different boot environments.

Reading OPnsense/Snapshots: Recommended Workflow explains the use quite well, e.g. if you want to test a config.

I think it would be clearer if it would be called 'Boot Environments'.
Deciso DEC740

And then we'd have to explain to non-ZFS and non-tech users what a snapshot and a "BE" is. It's just not going to fly.


Cheers,
Franco

Quote from: franco on January 17, 2026, 08:05:56 AMAnd then we'd have to explain to non-ZFS and non-tech users what a snapshot and a "BE" is. It's just not going to fly.
Well, you're the boss. You still have to explain to non-tech and non-ZFS people what a Snapshot is. Plus you also gotta explain to tech and ZFS people why these snapshots behave different then ZFS snapshots.
Deciso DEC740

January 17, 2026, 10:07:08 AM #4 Last Edit: January 17, 2026, 10:09:47 AM by tessus
I am not sure, whether the term "boot environments" works either. Maybe it's a better term, but this still doesn't solve my confusion. What would happen, if I were to delete the currently active one (which is also the only snapshot). Or will I get an error that this isn't possible?

But I still do not understand how exactly those snapshots work. So I create a snapshot before I run a firmware update. While I update the firmware, this new snapshot grows (which points to it persisting data). So how do I rollback? Or is all the data that has been persisted removed as soon as I set it active? How can one roolback, if data is persisted?

I also do not know how to rollback my default one (the currently active one) to the time it was created.

It seems that I am not alone with my confusion and unfortunately I was not able to resolve the disconnect I still experience when trying to understand opnsense snapshots.

P.S.: I haven't read up on the bectl link, but will do so later today. Thanks for the link. Maybe the link will make things clearer for me.

I dont know what to additionally clarify. The documentation explains these questions I think. Just try to read it from start to finish and if something is still unclear we can improve the documentation?

https://docs.opnsense.org/manual/snapshots.html
Hardware:
DEC740

The documentation is pretty clear. Plus the latest release brought a tooltip for snapshot states in the UI....

Also, PROXMOX e.g linux snapshots and fBSD snapshots are not the same thing. The later is more superior.

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G - VM HA(SOON)
N100   - i226-V | Crucial 16G  4800 DDR5 | S 980 500G - PROD

Quote from: Seimus on January 17, 2026, 01:03:33 PMAlso, PROXMOX e.g linux snapshots and fBSD snapshots are not the same thing. The later is more superior.
As fas as I know OpenZFS has become the default for both Linux and *BSD so there is no longer a difference between the two like there was in the past before the merge ?!
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Yes, but Proxmox VM snapshots are not ZFS snapshots. ZFS is not even mandatory for Proxmox.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Monviech (Cedrik) on January 17, 2026, 11:05:16 AMI dont know what to additionally clarify. The documentation explains these questions I think.

I mentioned in my original post that I have read the documentation and that I needed clarification. This means that the documentation is not clear to me. This is why I asked questions, which you did not answer but instead you deflected and pointed me to the documentation. I would not have asked the questions, if I knew the answers to them.

But I will paste the part of the documentation and then paste my questions below it in my next reply (I'm currently otherwise engaged).

Quote from: Seimus on January 17, 2026, 01:03:33 PMThe documentation is pretty clear. Plus the latest release brought a tooltip for snapshot states in the UI....

It is not, which I mentioned in my original post. The tooltips are useless to me, since they just explain what the abbreviations mean. (I can read the documentation and I am capabable of remebering 4 letters and their meaning.) They don't solve the disconnect I am having.

Quote from: Patrick M. Hausen on Today at 12:04:26 AMYes, but Proxmox VM snapshots are not ZFS snapshots. ZFS is not even mandatory for Proxmox.

You are (partly) wrong here. You needed ZFS to create snapshots for a VM in the past. Maybe it is now possible to create snapshots with LVM based filesystems as well, but if you are running ZFS (which I am), a VM snapshot is done by doing a ZFS snapshot in the background.

Quote from: tessus on Today at 12:52:42 AMYou are (partly) wrong here. You needed ZFS to create snapshots for a VM in the past. Maybe it is now possible to create snapshots with LVM based filesystems as well, but if you are running ZFS (which I am), a VM snapshot is done by doing a ZFS snapshot in the background.

Ah - so maybe my Proxmox memory failed me. It's been a while since I abandoned "yet another platform". Probably I confused it with ESXi.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Today at 01:20:15 AM #11 Last Edit: Today at 01:30:33 AM by OPNenthu
Quote from: tessus on January 17, 2026, 10:07:08 AMWhat would happen, if I were to delete the currently active one (which is also the only snapshot). Or will I get an error that this isn't possible?

It's not possible and you will get an error if trying to delete the active snapshot (which if you only have one, it is by definition also the active one).  Since these are boot environments rather than canonical ZFS snapshots, you can't just delete them all.  You need at least one active one to boot into* by default, and by convention this one gets the "default" label.  It's just a label though.  You can change it and name any snapshot you want as "default."

*unless you manually choose one from the boot menu.

This appears to be the question:
Quote from: tessus on January 17, 2026, 05:38:16 AMMy problem of understanding is why and when will a snapshot in OPNsense start to persist data? When I make it active for the first time? If so, this means I cannot use (rollback to) a snapshot more than once. e.g. how do I rollback to Sept. 2025 when the "default" snapshot was created?
Somehow there is a disconnect I cannot reconcile.
and this is a lay answer from my use of snapshots: essentially, you do not roll back to a date but to a version.

If I take a snapshot then I am preserving a (presumably) stable version. All normal operations of the router will continue to be reflected in that snapshot version as well as in the active. That is, it continues to update for operations ... but not for configuration.

Any configuration changes will be reflected in the Active version but not in the Snapshot version. If you like the changes and they are stable, you can make that the master simply by continuing to use it while optionally deleting the Snapshot. If you do not like the changes then revert to the Snapshot in which case your configuration changes will vanish yet the router will be operationally up to date. If your changes crash the router then you can recover safely to your snapshot on boot.

Snapshots reflect a configuration point, not a time point.

I will be interested to see whether my understanding is confirmed.
Deciso DEC697

Today at 01:57:49 AM #13 Last Edit: Today at 03:54:57 AM by OPNenthu
Quote from: passeri on Today at 01:36:36 AMSnapshots reflect a configuration point, not a time point.

That's a useful way to think of it.  Technically they are a snapshot of a point in time (in terms of data on disk), but as a mental model for OPNsense you are indeed effectively reverting to an older configuration when you activate a snapshot.  Not just configs, but installed packages & plugins too.

To add one thing to this (which was also asked about earlier), the reason a snapshot appears to grow over time is not because anything is changing or being persisted in the snapshot.  It's because of the differential nature of the snapshot with respect to the active one.  If I have an active snapshot now (call it 'default') and I take snapshot 'A', then at that instant 'A' will be essentially a free snapshot in terms of space because its state matches with the active one.

Over time and as more filesystem changes occur in the active one, the reported size of snapshot A will appear to increase, but this is only because it's reflecting the differences between 'A' and current ('default').

If A is never booted into, its "contents" don't change.  A non-active snapshot is effectively immutable, though I'm not sure if it actually is.  An active snapshot is mutable since it's the active boot environment where things are changing.

In ZFS terms, an active boot environment is like a cloned snapshot I guess (?)  Still new to ZFS overall so I could be wrong.


Edit: I'm not confident about this anymore since I noticed they are datasets.

Quote from: OPNenthu on Today at 01:20:15 AMIt's not possible and you will get an error if trying to delete the active snapshot (which if you only have one, it is by definition also the active one).  Since these are boot environments rather than canonical ZFS snapshots, you can't just delete them all.  You need at least one active one to boot into* by default, and by convention this one gets the "default" label.  It's just a label though.  You can change it and name any snapshot you want as "default."

Thanks for the explanation. This answer points to boot environment as patient0 mentioned. So those are not ZFS snapshots, even though the UI calls them snapshots. Got it.

Quote from: passeri on Today at 01:36:36 AMAll normal operations of the router will continue to be reflected in that snapshot version as well as in the active. That is, it continues to update for operations ... but not for configuration.

This is exactly what makes no sense. If I create a snapshot and then do a firmware update, it is an operation. Installing kernel, packages, and whatnot.
So how can I rollback or switch to a point where the new firmware was not installed, if the operations are persisted.

I will take the documentation apart and ask questions referencing the docs.