Stop hunting for persistent logs in volatile memory

Logging & Journald

Stop hunting for persistent logs in volatile memory

🧩 The Challenge

Dealing with a service that crashes right after boot is a nightmare when journald decides to keep all your logs in RAM. Once you reboot, the clues vanish into thin air, and you’re back to guessing what went wrong.

💡 The Fix

You need to tell systemd to stop being so temporary by creating a dedicated directory for the journal logs. This forces the daemon to write everything to the disk instead of clearing it out when the power cuts.

mkdir -p /var/log/journal
systemd-tmpfiles --create --prefix /var/log/journal
systemctl restart systemd-journald

⚙️ Why It Works

Creating this directory triggers the journald logic to automatically detect a persistent storage location, which is a massive relief when debugging kernel panics or early-boot service failures. The tmpfiles command ensures your permissions get set correctly without a reboot.

🚀 Pro-Tip: Check your settings in /etc/systemd/journald.conf to set a SystemMaxUse so you don’t fill up your partition while nobody is looking.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted