Canop / dysk

A linux utility to get information on filesystems, like df but better
https://dystroy.org/dysk
MIT License
890 stars 25 forks source link

reporting used space on btrfs volume when volume is empty. #78

Closed daniejstriata closed 1 month ago

daniejstriata commented 1 month ago

I just tried btrfs for the first time. I notice that the size reported is not correct (unless I misconfigured the btrfs mount). In total the volume is around 3 Gb. How is the used space calculated? At this stage I have nothing on that volume.

the mount is a raid0:

→ btrfs filesystem show /mnt/btrfs_pool
Label: none  uuid: baa9db51-b64a-4e6b-b9fe-af860e0ea51d
    Total devices 3 FS bytes used 144.00KiB
    devid    1 size 1.00GiB used 102.38MiB path /dev/nvme2n1
    devid    2 size 1.00GiB used 366.38MiB path /dev/nvme3n1
    devid    3 size 1.00GiB used 366.38MiB path /dev/nvme4n1

dysk 2.9.0 output: image

fstab:

#
UUID=05253aff-e1cb-4014-8b8d-d84667245b52     /           xfs    defaults,noatime  1   1
UUID=86F9-487E        /boot/efi       vfat    defaults,noatime,uid=0,gid=0,umask=0077,shortname=winnt,x-systemd.automount 0 2
UUID=baa9db51-b64a-4e6b-b9fe-af860e0ea51d /mnt/btrfs_pool btrfs defaults 0 0
tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel,size=2G 0 0
UUID=3a61036e-5cc0-4d4c-a91d-d591b5201f92 swap                  swap     defaults        0 0

Looking into this it seems BTRFS does not easily show total available space and dysk is doing that for me. Just not sure how the used space is calculated.

Canop commented 1 month ago

dysk calls statvfs

dysk's priority is to show what's really available, and "used" is what's not available, even if it's not used by you directly.