Logging & Journald
Stop journald from eating all your disk space with permanent logging
đź§© The Challenge
Dealing with a production server that suddenly goes read-only because journald decided to hoard ten gigabytes of logs is a nightmare nobody needs on a Tuesday. It happens when you forget that journald defaults to keeping everything forever if you didn’t touch the config.
đź’ˇ The Fix
Cap the total disk usage for logs by editing the journald config file to force a reasonable retention limit. You’ll save your partition and your sanity.
sed -i 's/#SystemMaxUse=/SystemMaxUse=500M/' /etc/systemd/journald.conf && systemctl restart systemd-journald
⚙️ Why It Works
By modifying the SystemMaxUse parameter, you tell journald to prune older logs once the total footprint hits that threshold, preventing it from ballooning until the disk is full.
🚀 Pro-Tip: Check the current usage with journalctl –disk-usage before you panic and clear everything out manually.
Linux Tips & Tricks | © ngelinux.com | 10/8/2026
