Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
The quick answer
[Journal]
Storage=persistent
SystemMaxUse=1G
MaxRetentionSec=1monthsystemctl restart systemd-journald
journalctl --list-boots | tail -3
journalctl --disk-usageStep by step
- Is it persistent now? If
--list-bootsshows only the current boot (0), older boots are lost:
journalctl --list-boots | tail -3
-2 3a1f… Mon 2026-11-17 02:10:01 +03—Tue 2026-11-18 03:12:44 +03
-1 8c2e… Tue 2026-11-18 03:13:20 +03—Thu 2026-11-19 10:01:02 +03
0 f4d9… Thu 2026-11-19 10:01:40 +03—Thu 2026-11-19 10:42:07 +03
ls -d /var/log/journal 2>/dev/null || echo "volatile only"- Make it persistent — the drop-in file (quick answer).
Storage=persistentcreates/var/log/journaland keeps logs there. - Set limits so it never fills the disk:
| Setting | Means |
|---|---|
SystemMaxUse=1G | Total size on disk. |
SystemKeepFree=2G | Always leave this much free on the file system. |
MaxRetentionSec=1month | Delete entries older than a month. |
MaxFileSec=1week | Start a new file each week (faster cleanup). |
- Restart journald (quick answer) — no reboot needed.
- Read the previous boot — the key use after a crash:
journalctl -b -1 -p warning --no-pager | tail -40
journalctl -b -1 -e-b -1 = the boot before this one, -p warning = warnings and worse, -e = jump to the end (the last lines before the crash).
- Free space now (keeps the newest entries):
journalctl --vacuum-size=500M
journalctl --vacuum-time=2weeks- Still need text files or central logs? rsyslog can write classic files from the journal, and Fluent Bit / Promtail can ship the journal to Loki or Elasticsearch.
Check that it worked
After the next reboot, journalctl --list-boots shows more than one boot, journalctl -b -1 shows the old boot, and journalctl --disk-usage stays under your limit.
Common problems
| Problem | Cause | Fix |
|---|---|---|
Only boot 0 is listed | Storage is volatile (/run/log/journal). | Storage=persistent and restart journald. |
/var/log/journal exists, still not kept | Wrong owner/ACLs after a manual mkdir. | systemd-tmpfiles --create --prefix /var/log/journal, restart journald. |
| The journal uses many GB | No SystemMaxUse (default up to 10 % of the FS, max 4 GB). | Set limits; --vacuum-size. |
Journal file … is truncated, ignoring file | Crash during a write. | Normal after a crash; old entries in other files stay. |
| Normal users see few logs | Only own logs without the right group. | Add admins to systemd-journal or wheel/adm. |
| The time in old boots looks wrong | Clock was not synced at that boot. | Fix NTP; logs keep the time the system had. |
Go further
- Command pages: journalctl, systemctl, systemd-tmpfiles.
- Next how-tos: Read and follow the logs of a service, Rotate log files with logrotate, See who logged in and when.
- Learn it: RHCSA — Persistent journal, RH134 — Persistent journal.
- Central logs: Loki, Fluent Bit.
- Practise: Lab: keep the journal and route your own logs.
1How do you read the logs from before the last reboot?
journalctl -b -1 — this needs a persistent journal.
2Which setting limits the journal's size on disk?
SystemMaxUse= in journald.conf (or a drop-in file).