Stop journald from eating all your disk space in a week
Logging & Journald
Stop journald from eating all your disk space in a week
🧩 The Challenge
You finally wake up to a production alert that your root partition is at 100% usage, only to find the culprit is a massive, bloated journald directory. It is infuriating to lose disk space to logs you never asked to keep forever.
💡 The Fix
You can clamp down on how much space the binary logs consume by editing the configuration file to enforce a strict size limit. This prevents your server from turning into a black hole of ancient log data.
sed -i 's/#SystemMaxUse=/SystemMaxUse=500M/' /etc/systemd/journald.conf && systemctl restart systemd-journald
⚙️ Why It Works
By modifying the SystemMaxUse parameter, you tell systemd exactly how many megabytes of space it is allowed to occupy on the persistent storage. Once it hits that threshold, it will roll the logs automatically.
🚀 Pro-Tip: Use journalctl –disk-usage to check if you are currently hemorrhaging space before you mess with the config.
Linux Tips & Tricks | © ngelinux.com | 11/29/2026
