diff --git a/admin/inertia/pages/easy-setup/index.tsx b/admin/inertia/pages/easy-setup/index.tsx index c1fab9b..2967c17 100644 --- a/admin/inertia/pages/easy-setup/index.tsx +++ b/admin/inertia/pages/easy-setup/index.tsx @@ -318,7 +318,19 @@ export default function EasySetupWizard(props: { system: { services: ServiceSlim } const primaryDisk = getPrimaryDisk() - const primaryFs = systemInfo?.fsSize?.[0] + // When falling back to fsSize (systeminformation), prefer real block devices + // over virtual filesystems like tmpfs which report misleading capacity. + const getPrimaryFs = () => { + if (!systemInfo?.fsSize || systemInfo.fsSize.length === 0) return null + const realDevices = systemInfo.fsSize.filter((fs) => fs.fs.startsWith('/dev/')) + if (realDevices.length > 0) { + return realDevices.reduce((largest, current) => + current.size > largest.size ? current : largest + ) + } + return systemInfo.fsSize[0] + } + const primaryFs = getPrimaryFs() const storageInfo = primaryDisk ? { totalSize: primaryDisk.totalSize, totalUsed: primaryDisk.totalUsed } : primaryFs diff --git a/install/sidecar-disk-collector/collect-disk-info.sh b/install/sidecar-disk-collector/collect-disk-info.sh index 09927d5..ec550c1 100755 --- a/install/sidecar-disk-collector/collect-disk-info.sh +++ b/install/sidecar-disk-collector/collect-disk-info.sh @@ -50,6 +50,22 @@ while true; do FS_JSON+="{\"fs\":\"${dev}\",\"size\":${size},\"used\":${used},\"available\":${avail},\"use\":${pct},\"mount\":\"${mountpoint}\"}" FIRST=0 done < /host/proc/1/mounts + + # Fallback: if no real filesystems were found from the host mount table + # (e.g. /host/proc/1/mounts was unreadable), try the /storage mount directly. + # The disk-collector container always has /storage bind-mounted from the host, + # so df on /storage reflects the actual backing device and its capacity. + if [[ "$FIRST" -eq 1 ]] && mountpoint -q /storage 2>/dev/null; then + STATS=$(df -B1 /storage 2>/dev/null | awk 'NR==2{print $1,$2,$3,$4,$5}') + if [[ -n "$STATS" ]]; then + read -r dev size used avail pct <<< "$STATS" + pct="${pct/\%/}" + FS_JSON+="{\"fs\":\"${dev}\",\"size\":${size},\"used\":${used},\"available\":${avail},\"use\":${pct},\"mount\":\"/storage\"}" + FIRST=0 + log "Used /storage mount as fallback for filesystem info." + fi + fi + FS_JSON+="]" # Use a tmp file for atomic update