Skip to content

Conversation

kxxt
Copy link
Contributor

@kxxt kxxt commented Aug 30, 2024

The disk capacity is wrong when a single file system is mounted multiple times, like:

/dev/mapper/root on /nix type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=263,subvol=/@nix)
/dev/mapper/root on /root type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=258,subvol=/@root)
/dev/mapper/root on /.snapshots type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=264,subvol=/@snapshots)
/dev/mapper/root on /home type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=257,subvol=/@home)
/dev/mapper/root on /srv type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=259,subvol=/@srv)
/dev/mapper/root on /var/cache type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=260,subvol=/@cache)
/dev/mapper/root on /var/lib/machines type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=267,subvol=/@machines)
/dev/mapper/root on /var/log type btrfs (rw,relatime,compress=zstd:5,ssd,space_cache=v2,subvolid=261,subvol=/@log)

It shows 16.15 TiB but the actual value should be near 2TB.

This PR fixes it by ignoring duplicated disks when calculating the disk capacity

@mmstick mmstick merged commit eb6ebb7 into pop-os:master Aug 30, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants