fix: correct backup preflight commands - lvs pve/data and dmsetup field documentation
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 6s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 5s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Successful in 4s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 5s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Successful in 2s

Fix two errors in the PREFLIGHT section (measured on acerpve 2026-09-15):
1. lvs -o ... pve/data (not pve-data-tpool) - this is the PRIMARY check that yields percentages directly
   - Quote the acerpve example: data 29.95% 1.22% <816.21g
2. dmsetup status pve-data-tpool - document fields correctly:
   -  = transaction ID (99), NOT data_percent
   -  = metadata used/total blocks
   -  = data used/total sectors
   - Show how to derive percentages if needed
3. Keep the error-state check (grep -q 'Error|Fail') - this is how the incident presented

Everything else stays: 1777 tmpdir requirement with EACCES symptom, incidents as rationale,
GPU-host fact, --output-format json rule, honest note that metadata/snapshot pressure is unproven.
This commit is contained in:
root
2026-09-15 11:42:10 +00:00
parent 65eaffe1c6
commit 69940bc9eb
+12 -5
View File
@@ -381,16 +381,23 @@ Two incidents from 2026-09-13/14 demonstrate that backup operations can catastro
Before starting ANY snapshot-mode vzdump on a host whose storage is an LVM thin pool, the following checks MUST pass:
```bash
# Check 1: Pool headroom
dmsetup status pve-data-tpool | awk '{print $4, $6}' # data_percent metadata_percent
lvs -o lv_name,data_percent,metadata_percent,lv_size pve-data-tpool
# Check 1: Pool headroom (PRIMARY - yields percentages directly)
lvs -o lv_name,data_percent,metadata_percent,lv_size pve/data
# Example output (acerpve):
# LV Data% Meta% LSize
# data 29.95 1.22 <816.21g
# Required thresholds (documented minimum):
# data_percent < 90% (80% recommended for safety margin)
# metadata_percent < 70% (metadata fills faster than data)
# Check 2: Verify pool is not in error state
# Check 2: Verify pool is not in error state (dmsetup shows the raw DM device)
dmsetup status pve-data-tpool | grep -q "Error\|Fail" && exit 1
# dmsetup output fields: <transaction-id> <metadata_used>/<metadata_total> <data_used>/<data_total>
# $4 is transaction ID (99), NOT a percentage
# Example: 0 99 26676/2183168 4005020/13372736
# Use $5 and $6 to calculate percentages if needed:
# data_percent = $6 / ($6 split by /) [second number in pair]
# metadata_percent = $5 / ($5 split by /) [second number in pair]
```
**Minimum thresholds**: If either `data_percent >= 90%` or `metadata_percent >= 70%`, the backup MUST NOT start. State explicitly that these are hard stops, not warnings.