fn mounts_for_device(device_name: &str) -> Vec<DiskMountMetrics>Expand description
Read /proc/mounts and return filesystem space for all mount points whose
source device path starts with /dev/<device_name> (covers partitions too).
Three filters/guards mirror the Python implementation and prevent inflation:
- Mount points under
/proc,/sys,/dev,/runare skipped — these are virtual hierarchies and frequent bind-mount targets. - Each unique source path (e.g.
/dev/sda1) is counted only once. The same source can appear at multiple mount points via bind mounts or btrfs subvolumes; without deduplication,statvfsreturns the same pool size for each entry, multiplying the reported total by the subvolume count. - Pseudo-filesystems with
f_blocks == 0are skipped afterstatvfs.