How much space is required for snapshots in ZFS?

5,739

Solution 1

The actual meta-data of snapshots are negligible.

As a copy-on-write file system, ZFS snapshots only require space for modified data; creating a snapshot does not immediately duplicate everything. If you have a snapshot of given size, and then add or modify files summing up to 100GB, the snapshot will "cost" you 100GB.

It might even be a little bit smaller because of compression and deduplication.

Solution 2

A snapshot initially takes a very negligible amount of space.

Its size grows later when existing data in the snapshotted dataset is updated or deleted.

The maximum size of a snapshot is the size of the original dataset unless compression and/or deduplication is enabled in which case you might have a snapshot smaller or larger than its parent dataset.

Share:
5,739

Related videos on Youtube

saeed
Author by

saeed

Updated on September 18, 2022

Comments

  • saeed
    saeed over 1 year

    How much space do snapshots use in ZFS?

    I created a pool and want to create a volume. I don't know how much space snapshots will occupy. Is there any way or formula exist to compute space requirements for snapshots?

  • jlliagre
    jlliagre about 9 years
    Good point about compression/deduplication. Note that the snapshot might be anything between much smaller and much larger in that case, not only a little bit smaller.
  • Jens Erat
    Jens Erat about 9 years
    For compression, there might be a slight overhead on already compressed data, yes. I don't think it should grow beyond the amount of data changed because of deduplication, or am I missing something here? Ignoring any file system overhead, but this would have existed anyway.
  • jlliagre
    jlliagre about 9 years
    You are right, the snapshot size cannot (significantly) exceed the zvol size, here 100GB. I was thinking in term of comparing the parent dataset used size and the snapshot used size. A 100GB zvol can use much less than 100GB and then be smaller than its snapshot if the latter is less compressed. Measuring the size used by deduplicated data is even more confusing as it exists only in one dataset but might be referred to by several ones.