Site icon New Generation Enterprise Linux

Stop journald from filling up your disk space until the system locks up

Logging & Journald

Stop journald from filling up your disk space until the system locks up

đź§© The Challenge

Dealing with a production box that went read-only because journald decided it needed to save every single debug log from a misbehaving python script is a special kind of hell. I spent three hours hunting down why my config files wouldn’t save, only to find the disk was 100% full of binary logs I didn’t even know I had.

đź’ˇ The Fix

You need to put a hard cap on how much disk space the journal is allowed to chew through. It’s an easy way to ensure your root partition doesn’t become a dumpster for useless logs.

journalctl --vacuum-size=500M
mkdir -p /etc/systemd/journald.conf.d/
printf "[Journal]\nSystemMaxUse=500M\n" > /etc/systemd/journald.conf.d/limits.conf
systemctl restart systemd-journald

⚙️ Why It Works

By creating a drop-in file in the config directory, you force the daemon to respect a size limit permanently rather than just clearing it once. The vacuum command handles the immediate cleanup so you can stop worrying about your disk space right now.

🚀 Pro-Tip: Use –vacuum-time=1weeks if you’d rather purge logs by age instead of total bytes.

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

0 0 votes
Article Rating
Exit mobile version