Site icon New Generation Enterprise Linux

Stop journald from eating your disk space for lunch

Logging & Journald

Stop journald from eating your disk space for lunch

đź§© The Challenge

Dealing with a server where the root partition hit 100% usage, only to find that /var/log/journal had ballooned to 20GB of useless historical logs. It’s frustrating when the system doesn’t prune itself intelligently and you’re scrambling to free up space while the database is down.

đź’ˇ The Fix

Use the journalctl vacuum options to limit how much disk space or how much time the logs actually occupy. It keeps your storage sane without you having to manually run rm on log files.

journalctl --vacuum-size=500M
journalctl --vacuum-time=2weeks

⚙️ Why It Works

These commands force journald to immediately drop older entries until the total directory size matches your specified limit or until all remaining logs fall within your chosen age window. Instead of letting the journal grow until your disk screams for mercy, you’re setting a hard boundary that the daemon actually respects.

🚀 Pro-Tip: Set SystemMaxUse in /etc/systemd/journald.conf to make this behavior permanent so you never have to think about it again.

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

0 0 votes
Article Rating
Exit mobile version