SOLVED Size discrepancy `zfs list` and `df` (USED/REFER); snapshot size

Supose

Dabbler
Joined
Dec 23, 2020
Messages
23
For one of my datasets `zfs list` and `df` show significantly different used numbers:

Code:
# zfs list | grep myDataset
NAME                                      USED  AVAIL     REFER  MOUNTPOINT
…
myPool/myDataset                          826G   573G      628G  /mnt/myPool/myDataset
…

# df -h | grep myDataset
Filesystem                  Size    Used   Avail Capacity  Mounted on
…
myPool/myDataset            1.2T    628G    573G    52%    /mnt/myPool/myDataset
…


That’s about 20% difference. I assume ZFS stores some metadata or snapshots or something like that which is not added up by using `df` (and `zfs list` REFER).

Is there a way to find out what is taking up all that space? And how to free that space?

The pool is a stripe using just one 3 TB disk; the dataset uses lz4 compression and currently has a ratio of 1.02.
Replicating the dataset with default setting makes it use 628G (also according to `zfs list`), so the data in question gets lost on the way.
 

Supose

Dabbler
Joined
Dec 23, 2020
Messages
23
Okay, `zfs list -o space` reveals that it’s (a) snapshot(s):

Code:
# zfs list -o space myPool/myDataset
NAME               AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD
myPool/myDataset    573G   826G      198G    628G             0B         0B


Now, how can I find out which one(s) it is?
 

Supose

Dabbler
Joined
Dec 23, 2020
Messages
23
Sorry, should have checked that out before asking. Found the answer:

zfs list -t snapshot myPool/myDataset
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Yes, a lot of newish TrueNAS or ZFS users forget about snapshots, (and potentially clones), taking up space. It also adds a layer of confusion in that snapshot storage space used varies depending on the differences from the source dataset.
 
Top