After a reboot, investigate a failure from the immediately preceding boot.
Persistent journal storage contains previous boot IDs.
Which command is appropriate?
journalctl -b -1 selects the boot immediately before the current one. Persistent journal storage is required for those entries to remain available.
Detailed explanation
journalctl -b 1Incorrect. -b 1 is not the relative previous-boot selector used here.
Incorrect. -b 1 is not the relative previous-boot selector used here.
journalctl -b -1Correct. -b -1 selects the immediately previous boot.
Correct. -b -1 selects the immediately previous boot.
journalctl -b 0 -fIncorrect. -b 0 -f follows the current boot.
Incorrect. -b 0 -f follows the current boot.
journalctl --rotateIncorrect. --rotate rotates journal files and does not select a boot.
Incorrect. --rotate rotates journal files and does not select a boot.
Try it yourself
An example you can run in a temporary verification environment.
journalctl --list-boots --no-pager 2>/dev/null | tail || echo 'persistent boot journal is unavailable'Expected result
保存済み起動のオフセットとboot ID、または未利用の表示Key points
- -b -1 means the previous boot
- -b 0 means the current boot
- Persistent journal storage is required
Notes
- Environment: Linux / systemd journal 255以降
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.