parity
SnapRAID sync, scrub and fix through the threshold guard.
Parity status and guard state
Reads SnapRAID status from the boot-device content file only — does not run `snapraid diff` or wake data disks. Threshold-guard state and grouped diff rows reflect the last explicit `POST /parity/diff` (or a sync job's own pre-sync diff) until the next one runs.
Run a SnapRAID diff
Runs `snapraid diff` on every data disk — an explicit user action that wakes every data disk. Returns grouped changes and threshold-guard evaluation for the parity page; never polled on a timer.
Start a SnapRAID sync
Queues a sync job through the threshold guard. A non-dry-run sync past a tripped guard requires `confirm: true` after reviewing the diff. Refused with 409 `on_battery` while the on-battery hold is active — scheduled syncs are held until power returns.
Start a SnapRAID scrub
Queues a scrub job (`hoserva scrub`). By default it skips blocks newer than 10 days; `allBlocks` scrubs every block.
Start a SnapRAID fix
Queues a fix job (`hoserva fix`). Requires `confirm: true` — fix rewrites data from parity. Without `path` the fix covers the whole array, or the one `disk`, and brings back every file changed or deleted since the last sync; with `path` it restores only that one file. Refused with 400 `invalid_fix_path` before a job is queued when `path` is not one file under `/mnt/user` or is sent together with `disk`. A fix that SnapRAID reports unrecoverable blocks for, with or without `path`, ends `failed`, never `succeeded`: SnapRAID exits 1, and the job's error gives the number of unrecoverable blocks and names the partial copies it left as `<name>.unrecoverable` on their disks, or says SnapRAID leaves them beside the file when its log names none; files it did recover stay restored. Without `path`, the error also says that SnapRAID can only rebuild what parity held at the last sync, and no more failed blocks than parity covers. With `path`, the error names the file and, when the log names the partial copy, gives one example cause: another file that shares its parity positions changed after the last sync. Any other non-zero exit fails the job too. A fix with `path` also ends `failed` when SnapRAID exits 0 with 'Nothing to do': the path matched nothing in parity (misspelt, the wrong case, a directory, a file made after the last sync, a file only on the cache) or the file is intact and needs no restoring, and the job reports that nothing was restored.