From 99eb86fa5cc227e7023af57f4883ca4f4fbcacff Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 29 Mar 2026 16:04:35 +0100 Subject: [PATCH] fix: disk usage shows encrypted data partition, not root Dashboard System card now reports disk usage for /var/lib/archipelago (the LUKS encrypted partition) instead of / (small root partition). This shows the actual usable storage (428GB) rather than the 29GB root. Co-Authored-By: Claude Opus 4.6 (1M context) --- core/archipelago/src/disk_monitor.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/archipelago/src/disk_monitor.rs b/core/archipelago/src/disk_monitor.rs index dd2bc392..e9868882 100644 --- a/core/archipelago/src/disk_monitor.rs +++ b/core/archipelago/src/disk_monitor.rs @@ -33,11 +33,18 @@ fn parse_df_output(stdout: &str) -> Result<(u64, u64, f64)> { Ok((used, total, percent)) } -/// Check disk usage percentage for the root filesystem. +/// Check disk usage percentage for the data partition. +/// Uses /var/lib/archipelago (encrypted LUKS partition) if available, falls back to /. /// Returns (used_bytes, total_bytes, used_percent). pub async fn check_disk_usage() -> Result<(u64, u64, f64)> { + // Prefer the encrypted data partition — this is where all user data lives + let data_path = if std::path::Path::new("/var/lib/archipelago").exists() { + "/var/lib/archipelago" + } else { + "/" + }; let output = tokio::process::Command::new("df") - .args(["--block-size=1", "--output=used,size", "/"]) + .args(["--block-size=1", "--output=used,size", data_path]) .output() .await .context("Failed to run df")?;