From 06dcdafda429322b1f1a05bd481d3b98ae102724 Mon Sep 17 00:00:00 2001 From: archipelago Date: Thu, 23 Apr 2026 09:54:16 -0400 Subject: [PATCH] fix(specs): measure DISK_GB at /var/lib/archipelago, not / The reconcile spec for bitcoin-knots auto-enables prune=550 when DISK_GB < 1000. DISK_GB was measured via `df /`, which on every archy install reports the ~30 GB OS partition because user data lives on a separate encrypted /var/lib/archipelago volume. Result: every archy node with a 2 TB data drive was silently being configured as a pruned node, and any bitcoin-knots container recreated by reconcile would delete its historical blocks down to the 550 MB prune window on next start. Observed on .228 (2 TB box): blocks dir went from 384 GB to 926 MB after a reconcile-triggered restart. Historical archive unrecoverable without full re-IBD from genesis. Fix: check /var/lib/archipelago first (where bitcoin data actually lives). Fall back to / only on first-boot before the data partition is mounted. --- scripts/container-specs.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/container-specs.sh b/scripts/container-specs.sh index 54ea0fa5..3bfc0852 100755 --- a/scripts/container-specs.sh +++ b/scripts/container-specs.sh @@ -26,7 +26,15 @@ done # ── Environment detection ───────────────────────────────────────────── detect_environment() { - DISK_GB=$(df --output=size -BG / 2>/dev/null | tail -1 | tr -dc '0-9') + # Measure disk where container data actually lives, not the OS partition. + # Archipelago installs mount a separate (usually-encrypted) data volume at + # /var/lib/archipelago on any host with meaningful storage, so checking / + # would always report the ~30 GB OS partition and wrongly trip prune mode + # on 2 TB boxes. Fall back to / only for first-boot before the data + # partition is mounted. + local disk_target="/var/lib/archipelago" + [ -d "$disk_target" ] || disk_target="/" + DISK_GB=$(df --output=size -BG "$disk_target" 2>/dev/null | tail -1 | tr -dc '0-9') DISK_GB=${DISK_GB:-500} TOTAL_MEM_MB=$(($(awk '/MemTotal/{print $2}' /proc/meminfo 2>/dev/null || echo 16000000) / 1024)) LOW_MEM=false