What are dmesg and the kernel ring buffer?
BeginnerConceptBoot Process & Kernel
Answer
The kernel logs messages (driver init, hardware errors, OOM kills, segfaults) into an in-memory ring buffer. dmesg reads it.
dmesg -T | tail -50 # human timestamps
dmesg -l err,warn
journalctl -k -b -1 # kernel messages from the previous boot
More on Boot Process & Kernel
Walk through the Linux boot process from power-on to login prompt.BeginnerWhat is the difference between BIOS and UEFI booting?IntermediateWhat does GRUB2 do and where is its configuration?BeginnerWhat is the initramfs and why is it needed?AdvancedHow do you view and change kernel command-line parameters?IntermediateWhat is systemd and why did it replace SysV init?Beginner