Logging & Journald
Stop wasting disk space on journald logs that never die
🧩 The Challenge
Dealing with a production box where the root partition hit 100% usage because systemd decided to hoard five years of binary logs is a special kind of hell. You end up digging through gigabytes of useless text when all you needed was the last hour of data.
💡 The Fix
Just set a hard limit on how much disk space the journal can chew through. It stops the journal from being a bottomless pit that eventually bricks your server.
journalctl --vacuum-size=1G
⚙️ Why It Works
Running this command forces the journal daemon to prune all existing logs until the total directory size drops below your specified threshold. It clears out the bloat immediately without you having to manually delete files and break the index.
🚀 Pro-Tip: Drop a config snippet into /etc/systemd/journald.conf.d/ to set SystemMaxUse permanently so you never have to think about this again.
Linux Tips & Tricks | © ngelinux.com | 10/17/2026
