Verify persistent storage is enabled

If /var/log/journal is absent, logs are volatile and lost on reboot. fix: mkdir + systemd-tmpfiles

journalctl --header | grep -iE 'file|state'; ls -d /var/log/journal 2>/dev/null || echo volatile

tool
journalctl12 commands
tags
journalctldisktroubleshooting

More journalctl commands

  • journalctl -p err -b --no-pager

    Only err/crit/alert/emerg from current boot; -p takes a range too (e.g. -p warning..err)

  • journalctl _SYSTEMD_UNIT=sshd.service --since today

    Trusted unit match by indexed field, unlike -u which also pulls coredumps/PAM noise

  • journalctl _PID=1 + _COMM=sshd -o short-iso

    A bare + is a logical OR between match groups; same-field matches within a group are OR'd too

  • journalctl --grep='oom|out of memory' --case-sensitive=false -b

    PCRE2 match on MESSAGE; pair with -p err to narrow noise. note: scans, not indexed

  • journalctl -u <name> -o verbose -n 1

    Dumps every journal field incl. cursor for an entry; -o json-pretty for machine parsing

all 12 journalctl commands