NVR Recording Retention Disk Full
Recording pipelines fail badly when retention only catches up after writes have already failed. The safer pattern is prune-before-write, a hard free-byte reserve, and backpressure before camera reconnects and segment writers start crash-looping.
Turn disk-full recording behavior into a reusable prune-before-write policy.
Copy the starter policy first: reserve free bytes, prune enough before opening the next recording segment, pause writers under pressure, and surface the largest recording bucket instead of only crash-looping.
reserve bytes -> prune enough -> pause writers -> report largest bucket
Measure recording growth, reserve risk, and writer crash loops.
Capture the disk state before deleting recordings so the retention policy can prove which camera, segment path, or job directory is driving the outage.
df -h RECORDING_ROOT; du -h -d 2 RECORDING_ROOT | sort -h | tail
Runbook: Prune Before The Next Recording Write
- Keep one recent known-good segment per required camera/source before deleting bulk history.
- Measure by camera/source directory, not only total disk usage.
- Set a hard reserve: for example, next segment budget plus 10-20 minutes of expected recording growth.
- Run retention before creating the next segment, not only after a successful write.
- When reserve cannot be restored, pause new writers and reconnect loops with a visible degraded status.
- Return an operator message with free bytes, largest source bucket, oldest retained segment, and next cleanup action.
Use this when NVR recordings fill storage faster than cleanup.
This separates immediate safety from the durable retention fix and avoids deleting the only recent footage sample.
I would turn this into a prune-before-write acceptance test:
- storage writability is checked continuously, not only at startup
- retention uses an absolute free-byte reserve, not only a percent threshold
- before opening a new recording segment, old segments are pruned until next-segment + reserve is available
- if reserve cannot be restored, writers enter a degraded/paused state instead of crash-looping
- the operator message names the largest camera/source bucket and oldest retained segment
Turn one NVR disk-full incident into a reusable retention policy.
The $99 policy is for recording, camera, backup, or segment-writing systems where cleanup must happen before the next write can fail. You get reserve thresholds, prune-before-write order, degraded-state behavior, and operator-facing failure messages for one representative workflow.