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) <noreply@anthropic.com>
This commit is contained in:
parent
2049707986
commit
99eb86fa5c
@ -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")?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user