Re: [List] Cannot find out what uses space in ZFS dataset

From: <freebsd_at_vanderzwan.org>
Date: Thu, 18 Sep 2025 18:00:15 UTC

> On 18 Sep 2025, at 19:39, Andrea Venturoli <ml@netfence.it> wrote:
> 
> On 9/18/25 18:44, freebsd@vanderzwan.org wrote:
> 
>>>> zroot/ROOT/default@auto_zroot-20250611020000            3.34G   209M          -       -              -         -
>>>> zroot/ROOT/default@auto_zroot-20250711020000            62.2G   407M          -       -              -         -
>> Here the refer jumps from 3.34 to 62.2 GB, so it looks like your missing data is in this snapshot.
> 
> Hmmm...
> 
>> # zfs list  -o name,refer,used,usedbysnapshots|grep default
>> zroot/ROOT/default             62.1G  70.5G     8.36G
> 
> usedbysnapshots is 8.36G, so I guess this single snapshot cannot take 60GB.
> Also "zfs send" doesn't transmit snapshots, so, even if this was true, it should not produce such a big amount of data.
> 
> 
> 
>> I guess  'zfs diff zroot/ROOT/default@auto_zroot-20250611020000  zroot/ROOT/default@auto_zroot-20250711020000'  can show what happened.
> 
> I know what happened on that day: I did a big upgrade of the system.
> However, I've done this hundreds of times on several boxes and never incurred in this problem.
> 
> 
> 
> 
> In any case, I tried deleting the 20250711020000 snapshot.
> Now the jump in refer just moved to the next:>  zfs list -t all -o name,refer,used,usedbychildren,usedbydataset,usedbyrefreservation,usedbysnapshots|grep default
>> zroot/ROOT/default                                      62.1G  70.5G         0B   62.1G             0B     8.36G
>> ...
>> zroot/ROOT/default@auto_zroot-20250611020000            3.34G   215M          -       -              -         -
>> zroot/ROOT/default@auto_zroot-20250810020000            62.1G   116M          -       -              -         -
>> ...
> Still "zfs send" generates the same huge amount of data.
> 
> 

That’s because for some reason the data is still referenced in snapshots.
If you delete all snapshots up to and including 20250810020000 you should see that usage drop to what you expect.
Including % in snapshot name would delete snapshots up to and including the named shapshot, so 'zfs destroy -v zroot/ROOT/default@%auto_zroot-20250611020000’ should work to free space.
Use -n first to verify the correct snapshots are deleted to be sure ;-)



Cheers,
	Paul