Enable Persistent Logging in systemd-journald on Linux

Deepak Prasad
Tested on RHEL 10.2 (Coughlan) — vm1.lab.example
Package systemd 257-23.el10_2.2
Applies to RHEL, Rocky Linux, AlmaLinux, Fedora, Ubuntu, Debian, and other Linux hosts using systemd as PID 1
Privilege sudo or root to create /var/log/journal, edit /etc/systemd/journald.conf.d/, and manage systemd-journald
Scope Enable on-disk journal storage with Storage=persistent or Storage=auto, restart journald, flush runtime logs, and verify logs survive reboot. Does not cover remote logging, retention limits, or journal namespaces.
Related guides journalctl command cheat sheet
How systemd-journald logging works
systemctl command
Beginners guide to systemd

By default, many Linux hosts keep journal data in /run/log/journal, which is cleared when the system shuts down. Persistent logging writes the same events under /var/log/journal so you can read earlier boots with journalctl after a restart.

The steps below were run on vm1.lab.example. You do not need to reboot the node; restart systemd-journald after config changes and use journalctl --flush when runtime logs should move to disk.


Quick answer

Create a journald drop-in:

bash
sudo mkdir -p /etc/systemd/journald.conf.d

Write Storage=persistent into a new drop-in file:

bash
sudo tee /etc/systemd/journald.conf.d/persistent.conf <<'EOF'
[Journal]
Storage=persistent
EOF

Apply it by restarting journald:

bash
sudo systemctl restart systemd-journald

Move any runtime logs into persistent storage:

bash
sudo journalctl --flush

Verify on-disk journal files and recorded boots:

bash
ls /var/log/journal/*/

Then confirm earlier boots are recorded:

bash
journalctl --list-boots

If Storage=auto is already active, creating /var/log/journal with the correct permissions and running journalctl --flush is sufficient.

Use a drop-in under /etc/systemd/journald.conf.d/ instead of editing /usr/lib/systemd/journald.conf directly. Package updates overwrite vendor files.


Check whether journald is already persistent

Start by reading the effective configuration and looking for journal files on disk:

bash
systemd-analyze cat-config systemd/journald.conf | grep -E '^Storage=|^#Storage='

Sample output on a host already set to persistent storage:

output
#Storage=auto
Storage=persistent

The commented #Storage=auto line comes from the vendor defaults in /usr/lib/systemd/journald.conf. The uncommented Storage=persistent line is the active setting, usually from a drop-in under /etc/systemd/journald.conf.d/.

Next, confirm journal files exist under /var/log/journal rather than only under /run/log/journal:

bash
ls /var/log/journal/*/

Sample output (truncated):

output
system.journal
system@000000000002c83b-0006596982cc774f.journal
user-1000.journal

Binary .journal files under a machine-ID directory mean journald is writing to disk. If /var/log/journal is empty but /run/log/journal holds active files, logs are still volatile and will not survive the next shutdown.


Storage=auto vs Storage=persistent

The [Journal] section of journald.conf controls where systemd-journald keeps data. The four supported Storage= values behave as follows:

Value Behavior
volatile Logs stay under /run/log/journal only; cleared at shutdown
persistent Logs go to /var/log/journal; journald creates the directory if needed; falls back to /run/log/journal during early boot or when the disk is not writable
auto Uses persistent storage when /var/log/journal exists and persistent storage is available; otherwise uses volatile storage until a flush switches it
none Drops stored journal data (console and kmsg output may still work)

Most default installs ship with Storage=auto. Creating /var/log/journal with the correct ownership can enable on-disk logging without editing the config file, but journald still needs journalctl --flush to move active runtime data from /run/log/journal into /var/log/journal.

Setting Storage=persistent is clearer because the setting states the intent explicitly and journald creates /var/log/journal for you on restart.


Enable persistent logging with Storage=persistent

Create a drop-in file so package updates do not overwrite your change:

bash
sudo mkdir -p /etc/systemd/journald.conf.d

Write the override with a here-document so the [Journal] header and Storage= line stay aligned:

bash
sudo tee /etc/systemd/journald.conf.d/persistent.conf <<'EOF'
[Journal]
Storage=persistent
EOF

Confirm the drop-in is visible in the effective config:

bash
systemd-analyze cat-config systemd/journald.conf | grep '^Storage='

Sample output:

output
Storage=persistent

Restart systemd-journald so journald reads the new setting. Red Hat documents this step for RHEL 9 and 10 after changing journald.conf:

bash
sudo systemctl restart systemd-journald

Journald should come back active immediately:

bash
systemctl is-active systemd-journald

Sample output:

output
active

Flush runtime journal data into persistent storage:

bash
sudo journalctl --flush

journalctl --flush asks journald to move data from /run/log/journal into /var/log/journal when persistent storage is enabled. It returns when the flush completes.

Confirm on-disk files exist after restart and flush:

bash
ls /var/log/journal/*/

Sample output (truncated):

output
system.journal
user-1000.journal

After restart, journald creates /var/log/journal with mode 2755 and group systemd-journal when the directory was missing.


Enable persistence with Storage=auto

When Storage=auto is the effective setting and /var/log/journal does not exist yet, journald keeps active data under /run/log/journal.

bash
sudo mkdir -p /var/log/journal

Create the directory, then let systemd apply the expected ownership and mode:

bash
sudo systemd-tmpfiles --create --prefix /var/log/journal

The directory should be owned by root:systemd-journal with mode 2755:

bash
stat -c '%a %U:%G %n' /var/log/journal

Sample output:

output
2755 root:systemd-journal /var/log/journal

Creating the directory alone does not move existing runtime logs. Flush journald so it switches from volatile storage to /var/log/journal:

bash
sudo journalctl --flush

List on-disk journal files once the flush finishes:

bash
ls -l /var/log/journal/*/

Sample output:

output
-rw-r-----+ 1 root systemd-journal 8388608 Aug 21 17:30 system.journal

You do not need to reboot for this path. A Storage=persistent drop-in plus systemctl restart systemd-journald is still the clearer long-term setup on servers you manage directly.


Verify logs survive reboot

Persistent storage is working when you can read log lines from a previous boot. List recorded boots:

bash
journalctl --list-boots

Sample output (truncated):

output
-1 9d4e7e19e5674973a6235b3622e30289 Fri 2026-08-21 11:14:35 IST Fri 2026-08-21 16:57:05 IST
  0 bbbe4ea74b0544ffa21f77c804d0a1f9 Fri 2026-08-21 14:21:27 IST Fri 2026-08-21 17:30:50 IST

Fetch the last few lines from the previous boot session:

bash
journalctl -b -1 -n 3 --no-pager

Sample output:

output
Aug 21 16:57:05 vm1.lab.example systemd-shutdown[1]: Syncing filesystems and block devices.
Aug 21 16:57:05 vm1.lab.example systemd-shutdown[1]: Sending SIGTERM to remaining processes...
Aug 21 16:57:05 vm1.lab.example systemd-journald[920]: Journal stopped

Seeing shutdown messages from -b -1 confirms those events were stored on disk, not only in the runtime journal.


Troubleshooting

Symptom Likely cause Fix
journalctl --list-boots shows only the current boot Logs still under /run/log/journal Set Storage=persistent, run systemctl restart systemd-journald, then journalctl --flush
Storage=persistent set but no files under /var/log/journal Service not restarted after the config change Run sudo systemctl restart systemd-journald, then sudo journalctl --flush
Directory exists but logs stay volatile under Storage=auto Runtime data not flushed yet Run sudo systemd-tmpfiles --create --prefix /var/log/journal, then sudo journalctl --flush
Permission errors on /var/log/journal Wrong owner or mode Run sudo systemd-tmpfiles --create --prefix /var/log/journal; directory should be 2755 root:systemd-journal

References


Summary

Persistent systemd-journald logging keeps boot history on disk under /var/log/journal instead of in the volatile runtime tree under /run/log/journal. Check the effective setting with systemd-analyze cat-config systemd/journald.conf, then add a drop-in with Storage=persistent when you want an explicit, durable default.

After any journald.conf change, restart the service with systemctl restart systemd-journald. Run journalctl --flush when runtime logs in /run/log/journal should move into persistent storage — including after you create /var/log/journal under Storage=auto. Confirm persistence with journalctl --list-boots and journalctl -b -1.

For reading and filtering stored logs, keep the journalctl cheat sheet nearby when you investigate services or earlier boots.


Frequently Asked Questions

1. What is the difference between Storage=auto and Storage=persistent in journald?

With auto, journald uses /var/log/journal only when that directory already exists and persistent storage is available; otherwise logs stay in volatile /run/log/journal until flushed or shutdown. With persistent, journald creates and prefers /var/log/journal even when the directory was missing before.

2. Do I need to reboot after enabling persistent journal logging?

No. After changing journald.conf, restart systemd-journald and run journalctl --flush. Under Storage=auto, create /var/log/journal with the correct permissions and run journalctl --flush without rebooting.

3. When should I run journalctl --flush?

Run flush after enabling persistent storage so journald moves data from /run/log/journal into /var/log/journal. Also run flush after creating /var/log/journal when Storage=auto is the effective setting.

4. Where are persistent journal files stored on disk?

Under /var/log/journal/MACHINE_ID/, with separate system and per-user journal files. Runtime-only logs live under /run/log/journal/ until flushed or until the system shuts down.

5. How do I check whether journald is already using persistent storage?

Run systemd-analyze cat-config systemd/journald.conf and look for Storage=persistent, then confirm journal files exist under /var/log/journal and journalctl --list-boots shows previous boots.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware.

  • Debian
  • Ubuntu
  • Linux
  • Red Hat Enterprise Linux
  • Shell Script
  • System Administration