Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs subvolume result in wrong disk calculation #40

Closed
imlonghao opened this issue Jun 23, 2022 · 1 comment
Closed

btrfs subvolume result in wrong disk calculation #40

imlonghao opened this issue Jun 23, 2022 · 1 comment

Comments

@imlonghao
Copy link

My VPS only has 20G disk

Device     Start      End  Sectors Size Type
/dev/vda1   2048     4095     2048   1M BIOS boot
/dev/vda2   4096 41943006 41938911  20G Linux filesystem

But yabs.sh said I got 60G

Disk       : 60.0 GiB
# df -t simfs -t ext2 -t ext3 -t ext4 -t btrfs -t xfs -t vfat -t ntfs -t swap --total 2>/dev/null
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/vda2       20969452 12098376   7625576  62% /nix
/dev/vda2       20969452 12098376   7625576  62% /persist
/dev/vda2       20969452 12098376   7625576  62% /boot
total           62908356 36295128  22876728  62% -
# mount | fgrep vda2
/dev/vda2 on /nix type btrfs (rw,relatime,compress-force=zstd:3,space_cache=v2,subvolid=259,subvol=/@nix)
/dev/vda2 on /persist type btrfs (rw,relatime,compress-force=zstd:3,space_cache=v2,subvolid=260,subvol=/@persist)
/dev/vda2 on /boot type btrfs (rw,relatime,compress-force=zstd:3,space_cache=v2,subvolid=258,subvol=/@boot)
@masonr
Copy link
Owner

masonr commented Jun 24, 2022

This is a known issue affecting certain filesystem types during the size calculation when using df. ZFS is another filesystem that this also affects (see #35). I don't currently have a good way currently of fixing this issue without overly complex logic to handle all the different fs types and edge cases, so for now this will left as a known bug without resolution. Appreciate the bug report!

@masonr masonr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants