Situatie
Need to get to the bottom of a hardware problem on Linux? The dmesg command is the fault finder’s friend.
Solutie
In Linux and Unix-like computers, booting and startup are two distinct phases of the sequence of events that take place when the computer is powered on. The boot processes (BIOS or UEFI, MBR, and GRUB) take the initialization of the system to the point where the kernel is loaded into memory and connected to the initial ramdisk (initrd or initramfs), and systemd is started.
The startup processes then pick up the baton and complete the initialization of the operating system. In the very early stages of initialization, logging daemons such as syslogd or rsyslogd are not yet up and running. To avoid losing notable error messages and warnings from this phase of initialization, the kernel contains a ring buffer that it uses as a message store.
A ring buffer is a memory space reserved for messages. It is simple in design, and of a fixed size. When it is full, newer messages overwrite the oldest messages. Conceptually it can be thought of as a “circular buffer.”
The kernel ring buffer stores information such as the initialization messages of device drivers, messages from hardware, and messages from kernel modules. Because it contains these low-level startup messages, the ring buffer is a good place to start an investigation into hardware errors or other startup issues.
That is where the dmesg command comes in.
What is The dmesg Command?
The dmesg
command allows you to review the messages that are stored in the ring buffer. By default, you need to use sudo
to use dmesg
.
sudo dmesg
Leave A Comment?