Embedded Linux Diagnostics: Budget Persistent Journal Storage Without Losing the Wrong Evidence
On a small-flash product, journal retention is a resource decision: which diagnostics must survive reboot, where they are stored and how much space remains for the application. A configured byte limit does not guarantee a particular number of days of history, and a vacuum operation does not account for every file consuming the device's storage.
This guide uses systemd v257 journal documentation. It concerns the operating system's diagnostic journal, not an application incident-pinning implementation. No logs were deleted or storage settings changed. Retention experiments should use disposable development data after any required evidence has been preserved.

Locate the journal that actually received the records
The tagged journald configuration reference distinguishes volatile, persistent, auto and disabled storage. Volatile records live under the runtime hierarchy. Persistent storage prefers the disk hierarchy but can fall back to runtime storage during early boot or when the disk is not writable.
With auto, the persistent directory's existence influences the choice. Therefore, the same application image can appear to have different reboot history when its surrounding filesystem setup differs. Inspect the effective storage mode, writable mounts and actual journal location before assuming an application failed to emit records.
Early-boot storage also has a transition. Journald initially uses volatile storage; the normal flush service moves it toward persistent storage under the documented conditions. A deployment that expects early failure evidence must qualify that path. Selecting persistent does not make an unavailable or read-only storage area writable.
Budget runtime and persistent storage separately
System-prefixed settings apply to persistent journal files; Runtime-prefixed settings apply to the runtime journal. On an appliance with constrained RAM and flash, these are separate budgets with different failure consequences. Changing only the persistent limit does not specify the early-boot runtime budget.
MaxUse constrains journal consumption, while KeepFree expresses space to leave for other uses. Journald respects both constraints. Neither is a general filesystem quota on the product database, downloaded updates or unrelated logs. If those consumers fill the filesystem later, journald does not become an automatic cleanup service for their files.
Use the product's actual partitions and write paths when estimating the combined budget. Record which consumer owns each space limit and what the product does when new diagnostics cannot be retained. Do not derive flash endurance from the retained journal size alone; retention and physical write workload are different quantities.
Distinguish active files from removable history
The journalctl reference explains why disk usage and vacuum results can disagree. Disk usage includes active journal files. Vacuum operates on archived files, so an active file remains outside that cleanup operation's ordinary removal set.
Rotation can make current files eligible for subsequent vacuuming. That is consequential: it changes which existing records can be removed. Treat rotation-plus-vacuum as an explicit retention action, not a harmless diagnostic query to run automatically while investigating an incident.
Individual file-size limits affect the granularity of reclaimable history. A small requested total does not imply that every byte above it is immediately removable, and a count limit can still leave active files in addition to the archived files retained. Explain the observed file states before deciding that the configured limit has been ignored.
Make a bounded retention promise
Suppose a gateway's ordinary log rate is low but a disconnected peripheral produces a burst of repeated errors. The same byte budget now represents a shorter period. A promise to retain a fixed number of days cannot follow from a byte limit alone without a qualified workload and admission policy.
Decide which reboot history is operationally necessary and how an incident is exported or otherwise preserved before ordinary cleanup. Do not promise unlimited recording and indefinite preservation on finite media. Keep any protected application evidence outside assumptions about journal rotation unless that integration has been deliberately designed.
On a development image, test normal boot, early failure before persistent storage becomes available, a controlled log burst and competing filesystem consumption. Compare retained boot identifiers and time ranges with actual storage use. These tests answer whether the chosen OS logging policy supports the product's diagnostic requirement; they do not establish universal retention duration or flash lifetime.