Stop letting journald rot your disk space

Logging & Journald

Stop letting journald rot 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 your systemd logs have been ballooning for months unchecked. I’ve spent too many Sunday mornings clearing out gigabytes of old logs just to get the box back on its feet.

💡 The Fix

You can cap the log size directly in the configuration so the system automatically purges the oldest entries before you run out of breathing room. It saves you from having to remember to rotate logs manually or nuking everything in a panic.

sed -i 's/#SystemMaxUse=/SystemMaxUse=500M/' /etc/systemd/journald.conf && systemctl restart systemd-journald

⚙️ Why It Works

By editing the journald.conf file, you force the daemon to respect a strict storage limit which prevents it from eating your root partition alive. A quick restart of the service ensures these limits take effect immediately without needing a reboot.

🚀 Pro-Tip: Use journalctl –disk-usage to check how much space you’re currently burning through before you set your limit.

Linux Tips & Tricks | © ngelinux.com | 11/16/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted