snapshot question

fuvasido

Cadet
Joined
Nov 30, 2020
Messages
1
I am new to setting up a FreeNas system. Now that things are working with sharing and my users have access to files, I am ready to run snapshots then store them offsite.

Here is what I don't understand. I did a manual snapshot of a dataset with 236mb of data. This was the first snapshot and it was 1.42 mb. I took two snapshots from other datasets manually. One dataset was 550 Gb and the snapshot is 504 kb. The last one was 1.1 tb and the snapshot was 2.4 mb. I get this data from the snapshot tab of the web interface. Am I not understanding what the interface is showing or did I do something wrong? Shouldn't the first snapshot be about the size of the dataset?

Mark
 

dakotta

Dabbler
Joined
Oct 12, 2018
Messages
42
Hello fuvasido,

I am new, also, and my explanation is very simplistic. If I write something that is wrong, hopefully someone will correct me.

For more detailed information, see:
How Do Snapshots Work?
Why Do Snapshots Increase in Size?

ZFS is a copy-on-write file system. That means: when you save a file you are working on, it is written to a new location on your hard drive, rather than overwriting the old file. If the write action is successful, then the original file is deleted.

A snapshot is like a timestamp. When you create a snapshot, all the files that are older than the snapshot become a part of the 'snapshot'. (Well, the metadata does, not the actual data, which is why your snapshots are so small.) If you edit and save a file after the snapshot is taken, then ZFS writes the new data to disk, but does not delete the old data.

So, each time you edit a file that is protected by a snapshot, more of your disk space is allocated. If you keep editing files, the space on your hard drive protected by the old snapshots keeps increasing and can become significant.

Cheers,
 
Top