journald.conf — Journal storage and retention
The systemd journal daemon reads journald.conf and drop-ins. Storage=auto uses persistent storage when the expected journal directory exists, otherwise volatile storage; persistent prefers disk and falls back to runtime storage during early boot or when disk storage is not writable, volatile uses runtime storage, none disables journal storage but may still allow forwarding. SystemMaxUse controls disk-backed journal space, not all text logs or guaranteed maximum total disk use; active files and keep-free rules matter. Drop-ins override main-file settings, with ordering by filename and directory precedence for collisions. The exact active settings and defaults depend on installed release and packaging. Review private configuration with cat-config; it displays merged input files, not daemon validation. Apply only in a VM with approved journald restart procedure; verify new logging and retention. Restore previous drop-in and restart if needed; deleted logs cannot be recovered from configuration rollback.
Formal Syntax & Structure
[Journal]Storage=auto|volatile|persistent|noneSystemMaxUse=SIZEParameters & Attributes
| Name | Type | Description |
|---|---|---|
| Storage | directive | Journal storage policy |
| SystemMaxUse | directive | Persistent journal size limit |
| RuntimeMaxUse | directive | Volatile journal size limit |
Return Value
Configuration input listing; not proof of applied retention.
Working Example
set -eud=$(mktemp -d)trap 'rm -rf -- "$d"' EXITmkdir -p "$d/etc/systemd/journald.conf.d"printf '[Journal]\nStorage=volatile\n' > "$d/etc/systemd/journald.conf"printf '[Journal]\nStorage=persistent\nSystemMaxUse=64M\n' > "$d/etc/systemd/journald.conf.d/90-bm.conf"systemd-analyze --root="$d" cat-config systemd/journald.conf > "$d/merged"grep -E '^(Storage|SystemMaxUse)=' "$d/merged"