SOLVED Snapshots taking more space than they say

TigerXtrm

Dabbler
Joined
Apr 26, 2012
Messages
36
Last week I was cleaning some stuff off my server and changed around some snapshot settings. The list of snapshots sadly doesn't give a 'total space used', instead only showing how much individual snapshots take, but after deleting a certain group of snapshots I suddenly found myself with an additional 500GB to spare. Now, I know for damn sure that tallying up all the deleted snapshots together did not even come remotely close to 500GB, so what gives? This experience makes me think that snapshots somehow take way more space than the UI claims they do (and it wouldn't be the first time that the UI displays inaccurate info).

Anyone have some insight to share on this?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Snapshots hold a link to any data that is part of the snapshot so that data space is still being allocated on disk. It isn't so much that the snapshot takes up space on disk as that any data referenced by the snapshot is still marked as allocated space on disk instead of being released to free-space. So any file that was changed or deleted would still be taking up space until the snapshot that points to it is deleted. As soon as the snapshot was deleted, all those file pointers were cleared and the space was returned to the pool as free.
 

TigerXtrm

Dabbler
Joined
Apr 26, 2012
Messages
36
Well, yes, but one would naturally assume that the number under 'used' is the amount of space being used for deleted or changed files. If that's not the case I'm vastly misunderstanding these numbers.

What does 'used' mean, and what does 'referenced' mean in the context of the snapshot UI?
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
The space reported is the amount of data that is unique to that snapshot. I like to give the example of a snapshot that was just made of a 1GB dataset. It "uses" 0B because all blocks are also referenced by the dataset. Now make a second snapshot, that one also references everything and also reports 0B used. Now delete all data in the dataset. Both snapshots still report 0B because all blocks are referenced by both snapshots. Now delete one snapshot and the other reports 1GB used because it is now the only snapshot that references that 1GB of data.
 

TigerXtrm

Dabbler
Joined
Apr 26, 2012
Messages
36
Is there a way to accurately display all space used or 'reserved' by all snapshots? Right now I feel like there is a blind spot in the system where space is being used, but isn't being reported as such anywhere in the UI. It makes the entire thing very confusing.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Yep, you want to use zfs list -o space and look at the USEDSNAP column.
I forget if this is displayed in the web UI anywhere.
 

TigerXtrm

Dabbler
Joined
Apr 26, 2012
Messages
36
Exactly what I was looking for, thanks!

Pretty big oversight that this is not visible in the UI though. This is crucial information for anyone looking to free up space or at least see the entire picture of their storage system.

To name an example from one of my datasets. UI says 'used' is barely a few MiB for all snapshots together, referencing about 200GiB per snapshot. Running your command it shows that same dataset's snapshots actually use almost 90GB.

@ Developers: Stuff like this makes the UI completely unreliable and useless for any serious data gathering. The data is obviously there, so please just show it. Correctly.
 
Top