Stop losing your logs when journald runs out of memory
Logging & Journald
Stop losing your logs when journald runs out of memory
🧩 The Challenge
You’ve probably spent hours trying to find a crash report from a service that died overnight, only to realize the journal was sitting in RAM and got wiped during the reboot. It’s infuriating when you need that backtrace and the disk is empty.
💡 The Fix
Tell systemd to actually save those logs to the persistent storage directory so they survive a hard reset. You’ll save yourself a headache the next time a box panics.
mkdir -p /var/log/journal && systemd-tmpfiles --create --prefix /var/log/journal && systemctl restart systemd-journald
⚙️ Why It Works
Creating the directory explicitly signals journald to switch from volatile memory to disk-backed storage. Once that folder exists, the daemon stops throwing logs into a temporary bucket that disappears the second you pull the power.
🚀 Pro-Tip: Check your retention settings in journald.conf or you’ll be drowning in gigabytes of old boot logs.
Linux Tips & Tricks | © ngelinux.com | 9/26/2026
