175 GB taken up by... what? Am I simply bad at simple math?

Joined
Oct 22, 2019
Messages
3,641
Code:
NAME                                                          USED         USEDSNAP    USEDDS       USEDREFRESERV   USEDCHILD
mainpool/zrootdata/media                                      929G         175G        754G         0B              0B
mainpool/zrootdata/media@manual-2020-05-06_14-56              112K            -        -             -               -
mainpool/zrootdata/media@manual-2020-08-05_17-33              0B              -        -             -               -
mainpool/zrootdata/media@manual-2020-09-05_21-03              0B              -        -             -               -
mainpool/zrootdata/media@manual-2020-12-23_17-34              336K            -        -             -               -
mainpool/zrootdata/media@manual-2021-01-05_16-10              194M            -        -             -               -
mainpool/zrootdata/media@backup-old                           1.4G            -        -             -               -
mainpool/zrootdata/media@backup-new                           0B              -        -             -               -


So the dataset media claims to be "using" 929 GB. Alright, fine. "Used by snapshots" makes up 175 GB of that, and "used by dataset" makes up 754 GB.

Makes sense, right?

Simple math:
754 + 175 = 929

The only problem is, why is "used by snapshots" claiming 175 GB, yet when you add up all the space used up by all the snapshots, it only comes out to about 1.6 GB?

Yes, those are all the snapshots listed above, from the command:
zfs list -r -o name,used,usedsnap,usedds,usedrefreserv,usedchild -t all mainpool/zrootdata/media

Am I missing where this mystery 175 GB went? This dataset has no children.

The following command yields 754 GB, not 929 GB (of which the remaining 175 GB is supposedly being used up by the snapshots.) But once again, the snaphots only total up to around 1.6 GB, not 175 GB.
Code:
# du -hs /mnt/mainpool/zrootdata/media
  754G    /mnt/mainpool/zrootdata/media


* Edited for correction, copying and pasting the terminal output cut off some lines.
 
Last edited:

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
My understanding is that you have 754 GB of current data, an extra 175 GB of old data that has been superseded or deleted in the current set and that 1.6 GB (1.4 GB + 194 MB + 336 kB + 112 kB) is used to track where all that data belongs.
 

Shkorna

Cadet
Joined
Feb 27, 2021
Messages
1
Hi, I didnt find way to create a post there so I am asking right there, I recenlty change my TrueNAS system to newer one. Both were used Windows 10 PC (both are HP machines) but the new one is saying that it doesnt find a boot device if I use SSD. The old system boot TrueNAS from SSD without any problem. The new one will boot only with USB stick. Any hints how to solve this problem? Thanks for any help or hint.
 
Joined
Oct 22, 2019
Messages
3,641
My understanding is that you have 754 GB of current data, an extra 175 GB of old data that has been superseded or deleted in the current set and that 1.6 GB (1.4 GB + 194 MB + 336 kB + 112 kB) is used to track where all that data belongs.

How does that work out, though? How is 1.6 GB used to track 175 GB worth of deleted / superseded data?

That's why I'm scratching my head. I could understand if the snapshots totaled up to 175 GB when added together, but they only total up to 1.6 GB. Why does it claim 175 GB is being "used by snapshots" for this particular dataset, of which no children exist?
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
The snapshots "use" only metadata space (1.6 GB). Hence, no change = 0 B snapshot.
The 175 GB are actual data, and will remain in the pool as long as the snapshots they belong to will be retained.
The way you invoked it zfs list does not tell you how much data is in any particular snapshot. It could, but then the numbers would still not "add up" because most of the data is common to several snapshots. You may find more explanations in chapter 6 of Free BSD Mastery: ZFS by Michael Lucas & Allan Jude. Recommended reading!
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
How does that work out, though? How is 1.6 GB used to track 175 GB worth of deleted / superseded data?

That's why I'm scratching my head. I could understand if the snapshots totaled up to 175 GB when added together, but they only total up to 1.6 GB. Why does it claim 175 GB is being "used by snapshots" for this particular dataset, of which no children exist?
Think of the snapshot as a list of pointers.
When you write to your dataset blocks are created. When you take a snapshot, the snapshot will record the list of the blocks that have been created since the previous snapshot.
The same applies to files that have been modified, deleted or moved. The existing blocks are not modified in any way due to the nature of ZFS, instead new blocks are created when the data/file needs to be modified. The snapshot will track the location of the old blocks and append the new ones.

You have to remember snapshots are not made of your files, just the location of the blocks where the files are located.
 
Top