Site icon New Generation Enterprise Linux

Stop journald from eating your entire disk with logs

Logging & Journald

Stop journald from eating your entire disk with logs

🧩 The Challenge

You finally get a call that a server is unreachable and find that /var/log/journal has ballooned to 20GB, completely filling your root partition and locking up the system. It’s annoying because by default, journald just grabs as much space as it feels like, which is usually way too much.

💡 The Fix

Setting a strict limit on the maximum size of the journal directory forces it to rotate older logs sooner, keeping your disk space usage predictable. You won’t have to scramble to clear space during an emergency ever again.

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

⚙️ Why It Works

This change explicitly tells the journal daemon to stop hoarding space once it hits that 500MB threshold. It clears out the oldest entries to make room for new ones, keeping your partition safe.

🚀 Pro-Tip: Use journalctl –disk-usage to check your current footprint before you trigger a panic.

Linux Tips & Tricks | © ngelinux.com | 7/18/2026

0 0 votes
Article Rating
Exit mobile version