aristocratos / bpytop

Linux/OSX/FreeBSD resource monitor
Apache License 2.0
10.07k stars 397 forks source link

[REQUEST] Correctly display ZFS available and used data #416

Closed Gnarflord closed 5 months ago

Gnarflord commented 5 months ago

I have a few ZFS datasets which I like to monitor but btop currently has issues with correct display of used, available and total space of ZFS datasets.

In my setup I have a main dataset datengrab which also contains two child datasets datengrab/jan-data and datengrab/till-data. datengrab/till-data also has a storage quota of max. 500GB. The available storage space can be easily queried like this (*):

❯ zfs list -r datengrab
NAME                  USED  AVAIL  REFER  MOUNTPOINT
datengrab            1.56T  1.96T  1.18T  /mnt/datengrab
datengrab/jan-data   42.9G  1.96T  27.6G  /home/jan/jan-zfs-dataset
datengrab/till-data   318G   182G   300G  /home/tills/till-zfs-dataset

df also lists the available and used storage correctly:

❯ sudo df -h
Filesystem                              Size  Used Avail Use% Mounted on
[...]
datengrab                               3.2T  1.2T  2.0T  38% /mnt/datengrab
datengrab/jan-data                      2.0T   28G  2.0T   2% /home/jan/jan-zfs-dataset
datengrab/till-data                     483G  301G  182G  63% /home/tills/till-zfs-dataset

(Confusingly zfs USED and df Size report two very different things. For anyone interested there's a nice blog post on the topic: https://zedfs.com/all-you-have-to-know-about-reading-zfs-disk-usage/)

But now look at what btop reports:

image

These numbers are all over the place! Most obviously:

I don't know how btop queries the disk usage under the hood but I hope this can be fixed somehow.

Gnarflord commented 5 months ago

Oh oops just noticed I've posted this in the bpytop repo, not btop. Will close and reopen!