View Previous Boot Logs on Raspberry Pi¶
Run sudo journalctl -b -1 to read the previous retained boot after a crash or bad shutdown. If that command has no previous boot to read, check which boots were saved and where Raspberry Pi OS stores the journal.
Find the boot that had the problem¶
Run these on the Pi. Use the timestamps in the first command to identify the boot where the problem occurred.
0 is the current boot, and -1 is the previous boot in the journal. After another reboot, you can use the BOOT ID from the list in place of -1 to return to the same log. journalctl boot selection
Use the kernel view for disk, USB or power messages. Use the service view when one app or service failed to start. Remove -n 80 if you need to read earlier entries. On a Pi 4B, these filters retrieved the matching entries from a test journal that contained two boot IDs.
If journalctl only shows the current boot¶
Check with sudo so you can see the system journal. If only boot 0 appears, inspect the combined configuration, including the Raspberry Pi OS drop-ins.
On the tested Pi 4B with Trixie, journalctl -b -1 reported no persistent journal was found. The raspberrypi-sys-mods package supplied 40-rpi-volatile-storage.conf with Storage=volatile. Journal files were under /run/log/journal even though /var/log/journal existed. With volatile storage, the journal is kept in memory and each reboot starts a new history. If persistent storage is already configured, check whether /var/log sits on a temporary overlay or older logs have rotated out. systemd journal storage settings · Raspberry Pi OverlayFS checks
Keep logs for the next reboot¶
On Raspberry Pi OS versions with the logging menu, open sudo raspi-config and select Advanced Options → Logging → Persistent. On the tested version, this creates an administrator drop-in that sets Storage=persistent.
If that menu is unavailable, create the directory with sudo mkdir -p /etc/systemd/journald.conf.d, then use sudoedit to put these lines in /etc/systemd/journald.conf.d/90-persistent-journal.conf:
On a system with writable persistent storage, apply the change and flush the current journal to disk. Confirm that your current boot appears in the persistent journal directory.
After your next planned reboot, run sudo journalctl --list-boots and check that the earlier boot is still present. Persistent storage keeps the current and future journal entries on disk. For an incident from before the saved journal begins, look for app-specific logs or a copy retained elsewhere. To manage disk use, set retention for the persistent journal. Limit journal disk use · systemd journal service