Read journals from another directory

Read journals from another root (rescue or forensics) without copying files

journalctl -D /mnt/crashed/var/log/journal -b -1 -p err

tool
journalctl12 commands
tags
journalctltroubleshootingdisk

More journalctl commands

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

    If /var/log/journal is missing, logs live in memory and are lost on reboot. Fix: mkdir + systemd-tmpfiles

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

    Show only err, crit, alert and emerg messages from the current boot. -p also takes a range, for example -p warning..err

  • journalctl _SYSTEMD_UNIT=sshd.service --since today

    Exact match on the indexed unit field. Unlike -u, it does not add coredump and PAM noise

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

    A single + means OR between match groups. Matches on the same field inside a group are also joined with OR

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

    PCRE2 match on the MESSAGE field. Add -p err to cut the noise. Note: this is a full scan, not an index lookup

all 12 journalctl commands