Where are snapshots stored ?

Status
Not open for further replies.

moon

Dabbler
Joined
Jul 17, 2014
Messages
32
The scrub of one my zpools is slower than it used to be and I'm trying to figure out the cause.

One of the things I'd like to consider is the amount of data scrubbed.
I assume snapshots are to be taken into account here.
However it doesn't look like the snapshot data are included in Storage/Volumes/Used and I can't also see it from a client (e.g. through CIFS).

Where does FreeNAS store snapshots ?
How can I check the size of the snapshot?

Thank you
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
The size of a dataset shown in the Storage | Volumes tab does include its snapshots.

Switch to the Storage | Snapshots tab to browse snapshots.

Trying to figure out where snapshots are 'stored' is really misunderstanding the whole concept. Here's a very simplified explanation:
  1. ZFS is a copy-on-write filesystem, meaning that when a block of data is modified, the old block is read, them modified in-memory, then written to a new location. Then the old block is marked as available for re-use.
  2. When a block of data is discarded because a file was deleted, that block is similarly marked as available for re-use.
  3. When a snapshot is created, the effect is to prevent all in-use blocks from being marked as available for re-use until that snapshot is destroyed. This explains why a snopshot takes virtually no time or space to create initially. It only begins to consume space when the blocks it references are modified or deleted, by preventing those blocks from being re-used.
 

moon

Dabbler
Joined
Jul 17, 2014
Messages
32
Robert,

thank you for your reply.

The "where" question is clear. Modified/deleted data are where they were before being modified/deleted. "Snapshot" is
 

moon

Dabbler
Joined
Jul 17, 2014
Messages
32
Robert,

thank you for your reply.

The answer to the "where" question is clear. Modified/deleted data are where they were before being modified/deleted. "Snapshot" is quite an appropriate name to be used ....

Still it is not clear how to determine the space used/consumed by the snapshot.
This is not included in the used in Storage/Volumes/Used but it has to be taken into account when calculating the free space in the vdev.
Should I sum all values in Storage/Snapshots/Used ?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Snapshot sizes are accounted for in the "used" column under Storage -> Volumes. You can use the CLI to view the specific snapshot size per dataset.
Code:
zfs list -o space
 
Status
Not open for further replies.
Top