See what happened *before* that last reboot
Logging & Journald
See what happened *before* that last reboot
🧩 The Challenge
Server just crashed or rebooted unexpectedly, right? Now you’re staring at fresh logs, but the problem happened before it went down. You need to see what actually caused the meltdown, not just the startup messages. It’s like trying to solve a crime by only looking at the clean-up crew. Nobody tells you this, but figuring out prior boot issues can be a real pain if you don’t know the trick.
💡 The Fix
There’s a super simple `journalctl` trick to jump back in time to previous boots. You can quickly check the logs from the boot right before the current one, or even further back, which is invaluable for debugging those frustrating intermittent reboots.
journalctl --list-boots
journalctl -b -1
⚙️ Why It Works
`journalctl` keeps track of every boot if you’ve got persistent logging enabled (and you *should*). The `–list-boots` command shows you all recorded boot sessions with their IDs and timestamps. Then, `-b -1` grabs the logs from the second-to-last boot, `-b -2` for the one before that, and so on. It’s super helpful.
🚀 Pro-Tip: Pair this with `journalctl -b -1 -p err` to quickly filter for just errors from the previous boot.
Linux Tips & Tricks | © ngelinux.com | 11/26/2026
