Quickly inspect recent kernel messages to diagnose hardware and boot-time issues. 16.11.2025 | reading time: 3 min The kernel ring buffer holds the most recent messages the kernel produced; reading it helps locate hardware errors, driver problems, and boot-time failures quickly using simple command-line tools like dmesg and journalctl. A failing NIC after an upgrade Imagine a freshly upgraded server where the network interface drops immediately; run `dmesg -T | tail -n 10` to inspect recent kernel output and find the culprit: ```bash $ sudo dmesg -T | tail -n 10 [Mon Nov 16 10:25:29 2025] e1000e 0000:00:19.0: eth0: Link is Down [Mon Nov 16 10:25:30 2025] e1000e 0000:00:19.0: eth0: Reset adapter [Mon Nov 16 10:25:31 2025] e1000e 0000:00:19.0: eth0: Link is Up - 1000 Mbps [Mon Nov 16 10:25:31 2025] kernel: pci 0000:00:19.0: firmware: failed to load driver-fw.bin ``` — from these lines he can tell that firmware loading failed and the driver reset the NIC, giving a clear lead for the next steps. Filter, follow and format Do not just dump everything; use `dmesg --level=err,warn` to surface problems, `dmesg -w` to follow live kernel events during tests, and `dmesg -T` to show human timestamps with the caveat that timestamps are approximate; when root is available `dmesg -C` clears the buffer and `dmesg -s 524288` increases the print buffer for very long messages. System journal gives history and context On systems with systemd the journal stores kernel messages persistently and with context, so `journalctl -k -b` shows kernel messages from the current boot and `journalctl -k --since "1 hour ago"` narrows a time window; compare `journalctl -k` and `dmesg` to get both historical context and the real-time ring buffer view. Permissions and interfaces Reading the ring buffer typically requires elevated privileges; `dmesg` reads the kernel buffer and `cat /dev/kmsg` or `cat /proc/kmsg` are lower-level interfaces on various kernels, while system services like rsyslog or systemd-journald can forward kernel messages to persistent logs for long-term analysis. Next steps for the investigator When the ring buffer points to a driver or firmware issue, gather kernel logs, check dmesg and journalctl around the event, reproduce with increased logging or a live follow, and then consult driver documentation or update firmware; keep practicing these steps to make diagnostics routine and reliable. Join Bits & Bytes Academy First class LINUX exam preparation. troubleshooting boot-process utilities processes