Calculating the space needed for snapshots

Status
Not open for further replies.

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
We will soon be building a fairly large FreeNAS box (30 times 6TB). (I'm planing on multiple RAIDZ2 volumes, compression, no dedup) This will be replicated to another box just like it for offsite storage.

Two questions:
1) It looks like when a snap shot is taken, the "total size" of the volume decreases by the size of the snapshot. This has the effect of reducing the "free space" but leaving the "allocated space" the same. Is this correct?

2) I'd like to keep a week's work of daily snaps, a month's work of weekly snaps, etc. Once I collect a few snaps, can I just average the size of the snaps and multiple it out to figure our how much total disk space I'm going to need? What I'm try to figure out is if I store 10 TBs of data, and if I create a snap of 10 MBs, can I just calculate (10 MBs * the number of snaps) + 10 GB = total disk space needed?

Luving FreeNAS and ZFS.

Thanks.

Dave
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
A snapshot takes as much space as has changed in the volume or dataset since it was taken, plus a negligible amount of overhead. Thus, at the moment you take a snapshot, it uses ~very little space (which is why creating a snapshot happens very quickly). As you add/remove/change data in that dataset, though, the snapshot will grow proportionally. Unfortunately, that means there's really no way to directly answer your questions.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
So in other words, each snap is a differential of the first snap, than incremental from the previous snap?
 

SirMaster

Patron
Joined
Mar 19, 2014
Messages
241
A snapshot is just what the blocks looked like at a certain point in time.

Deleting data or modifying data after taking a snapshot will make the snapshot size grow. Adding new data after taking a snapshot will not make the snapshot grow, it will make the volume grow.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
ZFS is Copy on Write, so the process is a bit like this:

Add some blocks of data:
  1. Ask the allocator for some free blocks and write to them
Edit/delete some blocks of data:
  1. Ask the allocator for some free blocks and write to them
  2. Were the original blocks snapshotted? If so, keep them. If not, mark them as free.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
I hate to bring this old post back to life, but I'm in the same situation again. How do I figure out from either the CLI or the GUI how much space a snapshot is costing me? There must be some way to figure this out. My end goal is to figure out how many MB/GB is transferred when I snapshot a dataset and then replicate it.

Thanks.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The GUI has a "Used" column in the Snapshots list...
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
This column does not appear to be an accurate representation of the disk space used by a snapshot. Either that or one of my busiest servers only has 30 MB of changes a day. Just looking for an explanation.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
zfs list -o space

This is giving me a number that is closer to reality.
 
Status
Not open for further replies.
Top