Cedar Shell

journald was quietly using 3 GB

A disk alert on a 20 GB server sent me looking for the usual suspects. It was not Docker and it was not a forgotten download. It was the journal.

$ journalctl --disk-usage
Archived and active journals take up 3.1G in the file system.

The default limit is a percentage of the file system, which is generous on a small disk. Two lines in /etc/systemd/journald.conf were enough:

[Journal]
SystemMaxUse=300M
MaxRetentionSec=1month

Then restart the daemon and trim what is already there:

systemctl restart systemd-journald
journalctl --vacuum-size=300M

Finding the noisy unit

Capping the size treats the symptom. To see who is writing, count lines per unit for the last day:

journalctl --since "24 hours ago" -o json \
  | jq -r '._SYSTEMD_UNIT // "kernel"' | sort | uniq -c | sort -rn | head

In my case it was sshd, logging thousands of failed logins from scanners. Password logins were already off, so the entries were only noise. I lowered LogLevel a step and the daily volume dropped by about ninety percent.