Logging & Journald
Stop journald from filling up your disk when things go sideways
đź§© The Challenge
Dealing with a production server where a runaway process flooded the logs until the disk hit 100% and the database locked up is a nightmare I know too well. You don’t realize it’s happening until the server stops responding to SSH.
đź’ˇ The Fix
Tweak the journald configuration to put a hard ceiling on how much space logs can occupy so you don’t wake up to a crashed partition. It forces the system to rotate out the old junk automatically.
sed -i 's/#SystemMaxUse=/SystemMaxUse=500M/' /etc/systemd/journald.conf && systemctl restart systemd-journald
⚙️ Why It Works
By uncommenting and setting SystemMaxUse, you tell the journal daemon to discard oldest entries once the limit is hit, keeping your root partition safe. Manual maintenance is a trap you should avoid at all costs.
🚀 Pro-Tip: Use journalctl –disk-usage to see exactly how much space you’re currently burning through before you set a limit.
Linux Tips & Tricks | © ngelinux.com | 8/22/2026
