Stop your journald logs from eating all your disk space
Logging & Journald
Stop your journald logs from eating all your disk space
🧩 The Challenge
Dealing with a production server that suddenly hits 100 percent disk usage is a nightmare, especially when you find out it’s just a mountain of ancient logs you didn’t even know were being kept. I’ve wasted way too many Saturday nights cleaning up /var/log/journal because I forgot to set a reasonable retention policy.
💡 The Fix
You can clamp down on how much space the binary logs take up by editing the configuration file to enforce a strict byte limit or a time window. It keeps the system responsive and prevents those midnight “disk full” alerts.
sed -i 's/#SystemMaxUse=/SystemMaxUse=500M/' /etc/systemd/journald.conf && systemctl restart systemd-journald
⚙️ Why It Works
By modifying the SystemMaxUse directive, you’re telling journald exactly how much disk space it’s allowed to grab before it starts rotating out the oldest entries. Systemd picks this up immediately once you cycle the service.
🚀 Pro-Tip: Use journalctl –disk-usage to check your current footprint before you panic and delete things by hand.
Linux Tips & Tricks | © ngelinux.com | 8/25/2026
