Stop systemd from dropping your logs when the disk gets full

Logging & Journald

Stop systemd from dropping your logs when the disk gets full

🧩 The Challenge

Dealing with a service that crashed in the middle of the night, only to find the journal is empty because your logs hit the size limit, is infuriating. Nobody warns you that journald just silently rotates or deletes files when it gets cramped.

💡 The Fix

You need to lock down the disk usage for journald so your system actually keeps the data you need for debugging, rather than letting it evaporate. Edit the configuration file to enforce a strict limit that fits your drive capacity.

echo -e "[Journal]\nSystemMaxUse=500M\nMaxRetentionSec=1month" >> /etc/systemd/journald.conf
systemctl restart systemd-journald

⚙️ Why It Works

Setting these parameters forces the journal to stop expanding aggressively and guarantees that you keep a predictable amount of history. Otherwise, you’re playing Russian roulette with your post-mortem data.

🚀 Pro-Tip: Run journalctl –disk-usage to see if your current logs are already hogging more space than they deserve.

Linux Tips & Tricks | © ngelinux.com | 8/12/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted