Skip to content

Field note

Keep Linux Journal Logs Within Disk Limits

A log policy needs both a storage budget and evidence that the required events arrive.

Published17 Oct 2026

Updatedyesterday

Read time4 min. 780 words.

When a Linux service fails overnight, the journal should help explain what happened. That becomes difficult if logs existed only in memory, a noisy application displaced the relevant history, or the disk filled while administrators assumed rotation was working.

Review logging as part of operating the service. Decide which events you need, how long they must remain available and where they will be investigated. Then allocate storage and test that the resulting configuration meets those requirements.

Establish what survives a reboot

systemd-journald supports persistent and volatile storage. Its auto behaviour depends on the journal directory's presence, so the default alone is not evidence that logs will survive a restart. The journald configuration manual describes these modes and their paths.

On the server, these read-only commands provide a starting point:

journalctl --disk-usage
journalctl --list-boots

Run them with the access required to see the intended system journal. The journalctl manual explains the commands and the effect of access permissions. Missing output can reflect visibility as well as missing data.

Check a known event from before the most recent planned reboot. Record how far back the relevant service's logs actually extend. A machine with a week of boot records may still have much less useful application history if that service produces large bursts of output.

Set a budget based on observed volume

Measure normal daily growth and a representative busy period. Include failed-job loops, deployment output and temporarily elevated debug logging. Decide how much space the host can safely allocate while leaving enough for application data, package operations and temporary work.

For a suitable test host, a proposed configuration might be:

[Journal]
Storage=persistent
SystemMaxUse=512M
SystemKeepFree=1G

These are illustrative values. Choose settings for the actual filesystem and workload, and apply them through the distribution's supported configuration mechanism. journald considers both its maximum-use limit and the requested free-space allowance. Active files and rotation behaviour mean these are not an instantaneous guarantee that observed usage always falls below one exact figure.

A size limit does not guarantee a duration of history. If the log rate increases, the same budget covers less time. Review the oldest retained event after a busy day and after a deployment, then adjust the storage or collection design if it misses the required investigation window.

Avoid manually deleting journal files as the routine fix for a capacity problem. Establish the cause and use the supported retention procedure during a controlled change. Preserve relevant evidence first if an incident is under investigation.

Watch for events that never reach storage

journald can rate-limit a service's messages and report that messages were dropped. Review these notices alongside application errors. A larger disk will not recover messages discarded before they were stored.

Find the cause of a logging burst before simply increasing the rate limit. An application repeatedly reporting a failed dependency may need a repair and a better retry policy. If high-volume events are legitimate and necessary, size both local storage and the receiving pipeline for them.

Check that logs do not contain passwords, tokens or unnecessary customer content. Access restrictions and sensible application logging reduce the number of sensitive copies created during routine troubleshooting.

Keep an independent copy where the business needs one

Local persistence is useful for diagnosis, but a failed or compromised host is a poor sole custodian of its own evidence. If central collection is required, choose a supported collector and a protected transport, then monitor delivery.

systemd's systemd-journal-upload is one documented option for forwarding journal entries to a configured server. Its existence does not mean the host is already forwarding. Verify the sender, destination authentication and the receiver's retention separately.

Generate a harmless, identifiable test event and locate it at the collector. Compare timestamps and host identity. During a planned test, check what happens when the collector is temporarily unreachable and whether expected events arrive after connectivity returns.

Assign an owner to collection failures and storage alerts. The completion evidence should show local history after reboot, the required events at the collector and sufficient capacity for the agreed period. Keep those observations with the service runbook so the next incident starts with usable records.

References

Related notes

Need help mapping this to your own tenant, controls, or assessment timeline?