Persistent systemd Journal Configuration
By default the journal lives on tmpfs and is destroyed at every reboot - so the logs explaining why a machine went down are gone by the time you can read them. This configures persistence and then actually reboots the machine to prove it, which is the only honest way to demonstrate the objective.
Operating Running Systems Guide 29 of 67 Intermediate
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 15 min
Storage=auto is the default: use /var/log/journal if that directory exists, otherwise /run/log/journal. So creating the directory is half the configuration, and on many systems it is the *whole* of it. Setting Storage=persistent makes the intent explicit and creates the directory if needed.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this before you need yesterday's logs. This matters because the journal lives on tmpfs by default and is destroyed at every reboot - and restarting the service is not the same thing as migrating it.
- finding where it is stored, and why that is a problem
- configuring persistence with a drop-in
- finding that restarting is not migrating
- leaving a marker and rebooting, then reading it back afterwards
- reading a previous boot, and capping the size
Before you start
- A sudo-capable account.
- The machine is rebooted in the middle of this guide. That is the point of it.
-
Where it is stored, and why that is a problem
-
Configuring it with a drop-in
-
Restarting is not migrating
-
A marker, and then a reboot
-
After the reboot
-
Reading a previous boot, and capping the size