mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
The previous reconciliation logic (issue #1052) used per-dataset statfs values for Total and Used. On Proxmox systems, statfs on a mounted dataset (e.g. rpool/ROOT/pve-1) only reports that dataset's own usage, completely missing zvols (VM disk images) and other datasets. This caused storage bars to show ~0% usage (a few GB of OS files) when the pool actually had terabytes of VM data allocated. Fix: derive usable pool capacity from the ratio of dataset Free (usable pool-available from statfs) to zpool Free (raw pool-available from zpool list). This ratio converts raw zpool Size to usable total, and Used is computed as Total - Free. This captures all pool consumers including zvols, handles RAIDZ parity overhead and mirrors uniformly, and produces correct usage percentages. Verified with tests for RAIDZ, mirrors, and both with zvols present.