Logging & Journald
Stop journald from eating your entire disk when logs go rogue
🧩 The Challenge
You wake up to a server screaming because the root partition is full, and after two hours of digging, you realize /var/log/journal is taking up 40GB of space. It happens because someone bumped the log level to debug and never turned it back.
💡 The Fix
You can clamp down on how much space the journal is allowed to hog, which forces the daemon to prune old entries automatically. It saves you from having to manually clear out logs when you’re already in a panic.
journalctl --vacuum-size=500M
journalctl --vacuum-time=7d
⚙️ Why It Works
These commands tell the journal daemon to immediately drop data until you’re under the specific size or time threshold you provided. Adding these to a systemd override or configuration file ensures the daemon respects those limits forever.
🚀 Pro-Tip: Edit /etc/systemd/journald.conf and set SystemMaxUse to 1G so you never have to deal with this mess again.
Linux Tips & Tricks | © ngelinux.com | 8/16/2026
