Can someone help me with Snapshots?

Started by ricardolanes, May 04, 2025, 08:21:19 PM

Previous topic - Next topic
I don't understand how this snapshot works, can someone explain it to me?

default - system initial
bkp.20250426 - I generated it on this date - 2025-04-26
snap.20250504 - I generated it today - 2025-05-04

What confuses me is
- which one is active?
- why are the sizes so different?

waiting, thanks!

Ricardo Lanes
Information Security Analyst
ricardo@lanes.rio
------
- OPNsense 25.1.5_5/AMD64
- Alder Lake N100 @ 16GB DDR5
- NIC INTEL 1225x6 2.5G
- 128GB SATA 3.0
- UPLINK 800MB/ 500MB
- UPLINK 500MB/ 300MB

20250426 is active (N)ow and on next (R)eboot.

The sizes are an artifact of the ZFS snapshot mechanism and don't matter much. Most important is snapshots (or boot environments in official FreeBSD/Solaris parlance) are not complete copies but frozen pointers to on-disk structures.

The active one is shown as 1.36 G because that is the size that is currently occupied by it. The 34.8 M or 8 K respectively are the data that these snapshots hold in addition to what is in the current one, because that amount of data has meanwhile been deleted.

If you take a new snapshot *now* its size will be zero. If you then delete 100 M from your active boot environment, the size of that snapshot just taken will be shown as 100 M.

Here's a presentation in case you are interested in more details:

https://vermaden.wordpress.com/wp-content/uploads/2018/11/nluug-zfs-boot-environments-reloaded-2018-11-15.pdf
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Also in the docs is explicitly explained which one is active and what the flags mean>

https://docs.opnsense.org/manual/snapshots.html#tutorial

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

Thank you very much!
Ricardo Lanes
Information Security Analyst
ricardo@lanes.rio
------
- OPNsense 25.1.5_5/AMD64
- Alder Lake N100 @ 16GB DDR5
- NIC INTEL 1225x6 2.5G
- 128GB SATA 3.0
- UPLINK 800MB/ 500MB
- UPLINK 500MB/ 300MB