OPNsense Forum

English Forums => General Discussion => Topic started by: ricardolanes on May 04, 2025, 08:21:19 PM

Title: Can someone help me with Snapshots?
Post by: ricardolanes on May 04, 2025, 08:21:19 PM
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!

(https://i.postimg.cc/HLShz6G3/DB020-BB1-BB28-4-C12-9394-F7692808129-E.png)
Title: Re: Can someone help me with Snapshots?
Post by: Patrick M. Hausen on May 04, 2025, 08:37:56 PM
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
Title: Re: Can someone help me with Snapshots?
Post by: Seimus on May 05, 2025, 11:51:32 AM
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.
Title: Re: Can someone help me with Snapshots?
Post by: ricardolanes on May 05, 2025, 02:30:18 PM
Thank you very much!