Stop guessing why your journald logs are suddenly gone
Logging & Journald
Stop guessing why your journald logs are suddenly gone
🧩 The Challenge
Ever been paged at 3 AM because of a production crash, only to find the logs from two hours ago were already nuked by a full disk? It is infuriating to watch your troubleshooting history vanish just because some developer decided to log every single network packet in verbose mode.
💡 The Fix
You can pin down exactly how much space those logs take up so you aren’t fighting for disk space during a major incident. Setting a hard limit on the journal size keeps the system stable and stops the binary log files from bloating until they eat your root partition.
sudo journalctl --vacuum-size=1G
sudo sed -i 's/#SystemMaxUse=/SystemMaxUse=1G/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
⚙️ Why It Works
Running the vacuum command manually clears out the junk immediately, but editing the config file ensures the system doesn’t let the journals balloon again. Systemd enforces these limits during every rotation cycle, so your disk usage stays predictable.
🚀 Pro-Tip: Set SystemMaxFiles to something like 5 or 10 if you want to keep your directory listing sane.
Linux Tips & Tricks | © ngelinux.com | 11/24/2026
