braid ack
Note
Experimental 🧪
This command is experimental: the idea or implementation is still uncertain and may be removed, replaced, or overhauled before braid v1.0.
Acknowledges active alerts and silences the PC speaker beeper. On a mounted pool it also records the acknowledged state so the same condition won’t immediately re-trigger: device error counts become the new baseline, and a still-at-risk ENOSPC capacity warning is snoozed for a reminder interval – a snooze, not a resolve, so braid status keeps showing the live capacity advisory.
When to use it
- The beeper is going off and you’ve investigated the cause.
braid statusorbraid tuishows active alerts you’ve already addressed.- After replacing a disk or running a scrub to clear errors.
Basic example
sudo braid ack
Output:
acknowledged 3 alerts
If there’s nothing to acknowledge:
no active alerts
Exit codes
| Exit code | Meaning |
|---|---|
| 0 | Alerts acknowledged, or nothing to acknowledge |
| 1 | Lock contention (retry once the other operation finishes), or an ack failure (offline btrfs-error refusal, probe/fstype error, cleanup I/O) |
| 2 | Setup error – config could not be read, or pool-lock I/O error |
What happens under the hood
- Reads the alert latch to determine how many alerts are active.
- If the pool is mounted:
- If a latch entry exists, the smartd alert flag is present, the scrub-failed flag is present, or the latch is corrupt, snapshots the current
btrfs device statserror counters and missing-device state. - Writes that snapshot as the new acknowledged baseline (
acked-stats.json). Future monitor runs compare against this baseline, so the same error counts won’t trigger again. - If a latched
EnospcRiskis still at risk on a freshbtrfs device usageprobe, writes a snooze marker (enospc-ack.json) with a reminder deadline one interval (7 days) out. This snoozes the monitor reminder – it does not resolve the risk, andbraid statuskeeps showing the live advisory. If the pool has recovered by ack time, no marker is written, so a later recurrence alerts immediately. - If none of those alert sources is present, exits 0 with
no active alertsand does not query btrfs or rewriteacked-stats.json.
- If a latch entry exists, the smartd alert flag is present, the scrub-failed flag is present, or the latch is corrupt, snapshots the current
- Stops both alert units, best-effort:
braid-alert.service(the Critical beeper – that stop cascades throughBindsToto thebraid-beep.serviceloop when beeping is enabled) andbraid-alert-advisory.service(the non-beeping Warning advisory started on the proactive ENOSPC/capacity path). One ack silences whichever tier the last monitor cycle started. This runs first so the stop attempt is reached before any later file-removal I/O error can short-circuit the rest of cleanup. - Removes the smartd alert flag (
smartd-alert) if present. - Removes the scrub-failed flag (
scrub-failed) if present. - Removes the alert latch file (
alert-latch.json). - Removes the corrupt-latch sidecar (
alert-latch.json.corrupt) if present.
Offline ack. When the pool is locked or unmounted, an EnospcRisk ack still clears the latch but writes no snooze marker (offline cannot probe the pool key or confirm risk). A still-at-risk pool re-fires EnospcRisk – a quiet Warning, no beep – on remount and each subsequent mounted cycle until a mounted ack snoozes it.
On a cleanup I/O error, ack preserves retry state so the next braid ack resumes cleanup after the I/O fault is fixed.
When ack reaches cleanup and a later cleanup step fails, it leaves /var/lib/braid/alert-cleanup-pending. braid status surfaces ack cleanup pending -- re-run `braid ack` to resume as an alert cause until cleanup finishes. If that sentinel is the only remaining alert signal, the next braid ack re-enters cleanup directly (no btrfs probe, no baseline rewrite) and prints acknowledged current alerts on success – expected output because only leftover cleanup ran.
When the pool is offline (no mount at the configured mount point), braid ack cannot run btrfs device stats, so what it can clear depends on which alert signals are present:
- A smartd alert – a latched smartd cause, a bare
smartd-alertflag present at ack entry, or both – clears any latch and removes thesmartd-alertflag; noacked-stats.jsonwrite is needed. - A scrub failure – a latched
ScrubFailedcause, a barescrub-failedflag present at ack entry, or both – clears any latch and removes thescrub-failedflag (mirroring the smartd source); noacked-stats.jsonwrite is needed. - A latched computation error clears the latch; it re-fires on the next monitor cycle only if the underlying computation still fails.
- A latched missing device is recorded as acknowledged in
acked-stats.json(so the next monitor cycle stays quiet) and the latch is cleared, without querying btrfs. - A latched btrfs device error is refused: ack exits 1 with
cannot ack btrfs device errors while pool is offline -- unlock the pool firstand leaves all alert state untouched, because re-baselining the error counters needs livebtrfs device stats, which requires the pool mounted. The refusal is all-or-nothing – a co-latched missing device is not partially acknowledged, so unlock and re-run to clear everything.
If that mount point is occupied by a non-btrfs filesystem, braid ack returns a probe error naming the fstype and preserves alert-latch.json, smartd-alert, scrub-failed, and acked-stats.json.
See ADR 014: Offline ack policy for the rationale.
Flags
None.
Safety checks
- If the pool is offline and no alert signal is present – no latch entries, no smartd alert flag, no scrub-failed flag, no corrupt latch, and no pending ack cleanup – ack refuses with “pool is not mounted – nothing to acknowledge”
- If the pool is offline and any latched cause is a btrfs device error, ack refuses with “cannot ack btrfs device errors while pool is offline – unlock the pool first” and leaves all alert state untouched (a co-latched missing device is not partially acknowledged).
- If the pool is mounted but healthy with no latch entries, no smartd alert flag, no scrub-failed flag, and no corrupt latch, ack is a no-op and does not mutate
acked-stats.json - If the configured mount point is mounted as something other than btrfs, ack refuses with the fstype mismatch and does not clear or rewrite alert state
- If another braid operation holds the pool lock (
/run/braid-pool.lock), waits up to 10 seconds for it to finish: proceeds if the lock frees within that window, otherwise exits 1 with the pool-lock retry message.
Related commands
- monitor – the automated check that triggers alerts
- status – view active alerts
- tui – interactive dashboard shows alert state