brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl -k -b -1 reads the kernel log of the previous boot

Journalctl
~/tips/tip-journalctl-kernel-previous-boot

journalctl -k -b -1

Shows kernel messages from the previous boot, which dmesg has already lost.

After a crash and reboot, the plain dmesg output only covers the current boot.

journalctl -k -b -1
journalctl -k -b -1 -p warning

-k (--dmesg) limits the output to kernel messages, and -b -1 picks the boot before the current one. Adding -p warning narrows it to warnings and worse. It needs a persistent journal, otherwise the previous boot is gone. Messages from the last seconds before a hard power loss may be missing, because they never made it to disk. Add -x to get short explanations for some well-known messages.

Further reading: journalctl manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link