Read boot messages and hardware state on Linux
Read boot logs (boot, journalctl, dmesg) and inventory the hardware detected by the kernel.
To understand a failed boot or a device that is not detected, two sources are useful: the boot log and the kernel messages.
Boot log (bootlogd)
The bootlogd package records the boot messages in /var/log/boot.
sudo apt-get install bootlogd
The file contains terminal escape sequences. Replace them to make it readable:
sed $'s/\^\[/\E/g;s/\[1G\[/\[27G\[/' /var/log/boot
sed $'s/\^\[/\E/g;s/\[1G\[/\[27G\[/' /var/log/boot | more
sed $'s/\^\[/\E/g' /var/log/boot
systemd journal
sudo journalctl
Kernel messages
dmesg
dmesg | tail -10
dmesg | less
dmesg | grep sda
Hardware inventory
lspci
lsmod
lsusb
lspcilists the PCI devices.lsmodlists the loaded kernel modules.lsusblists the USB devices.