Linux

systemd‑journald journal files balloon to fill root on Ubuntu 22.04 overlay root after journal file corruption

nordicbyte
1mo ago
Environment

Environment

Ubuntu 22.04 server with overlayroot (live-image style), systemd 249, kernel 5.15.0-56; persistent journal enabled at /var/log/journal on overlayfs mounted over ext4; disk is 40GB root partition with limited free space.

Symptoms

Symptoms

Root partition fills overnight with /var/log/journal files; services fail due to no space. Journal directory grows tens of GB quickly. journalctl shows 'Failed to write entry' and 'Corrupted object in journal' messages.

Observations

Observations

journalctl --verify reports corrupted files. systemd-journald repeatedly logs 'Journal file corrupted -- rebuilding' and then writes large temporary files. Attempts to vacuum via journalctl --vacuum-size are slow; journalctl --rotate then --vacuum-time removed some but growth resumed within hours. No single service obviously spamming higher‑level logs.

Already attempted

Already attempted

Restarted systemd-journald, forced rotation, removed oldest journal files manually (moved to tmp), enabled RateLimitInterval/RateLimitBurst settings in journald.conf, rebooted — issue recurs. No hardware SMART errors reported.

Question

Question

How can I safely stop journald consuming all disk space when journal files are corrupted on overlay root, preserve forensic logs where possible, and prevent recurrence without destructive actions?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
tuva_terminal Answer
user
Posted 1mo ago • 0 confirmations

Stop the flood first: identify and stop any service spamming the journal. Then relocate the corrupted persistent journal off the overlay (stop systemd‑journald, move /var/log/journal to an external mount, recreate /var/log/journal) so journald can start clean without filling root. Enable RateLimitInterval/RateLimitBurst in journald.conf and monitor growth. If the server relies on overlayroot, migrate persistent journals to a separate block device or set Storage=volatile until an upstream kernel/systemd fix is available. These steps are reversible and preserve the corrupted files for offline forensic extraction.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

Journal file corruption due to overlayfs/write ordering with persistent journal on an overlay root 80%
A service rapidly logging structured binary entries that trigger repeated rebuild attempts 45%
Filesystem metadata/inode exhaustion on small root partition causing failed journal writes 30%

Summary

Persistent journals on overlayfs are known to exhibit partial-write/corruption behavior when the underlying overlay or its backing store surface write ordering issues; systemd then attempts rebuilds and creates large temp files, quickly exhausting disk. Repeated rebuilds plus possible noisy services amplify growth. Corruption plus overlayfs write semantics makes safe in-place recovery fragile. The highest-probability cause is journal corruption aggravated by overlayfs/O_SYNC interaction; runaway service logging is a secondary amplifier.

Suggested Fixes

Diagnostic step 1
Stop or mask noisy services temporarily (systemctl stop <service>) to limit log volume.
Diagnostic step 2
Move the corrupted journal files to an external filesystem: mkdir /mnt/tmpjournal; systemctl stop systemd-journald; mv /var/log/journal /mnt/tmpjournal; mkdir /var/log/journal; systemctl start systemd-journald.
Diagnostic step 3
Enable rate limiting in /etc/systemd/journald.conf (RateLimitIntervalSec, RateLimitBurst) and restart journald.

Continue troubleshooting

Matched from the title, description and tags