Inspect config logs in dmesg
In this step, we'll inspect the kernel logs using the dmesg
command to find information about the kernel configuration. dmesg
is a command-line utility that prints the kernel's message buffer. This buffer contains information about hardware, drivers, and other system events, including details about the kernel configuration at boot time.
To view the kernel logs, use the following command:
dmesg | less
This command pipes the output of dmesg
to the less
command, which allows you to scroll through the logs.
The kernel configuration information is usually printed at the beginning of the logs during the boot process. To filter the logs and find configuration-related messages, you can use the grep
command.
Try the following command to search for lines containing "config":
dmesg | grep config | less
This command pipes the output of dmesg
to grep config
, which filters the lines containing the word "config", and then pipes the result to less
for easy viewing.
You might see output similar to this:
[占位符: 时间戳] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-[占位符: kernel version] root=UUID=[占位符: UUID] ro quiet splash vt.handoff=7
[占位符: 时间戳] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-[占位符: kernel version] root=UUID=[占位符: UUID] ro quiet splash vt.handoff=7
[占位符: 时间戳] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS [占位符: BIOS version] 04/01/2014
You can also search for specific configuration options. For example, to find out if CONFIG_EXT4_FS
is enabled, use the following command:
dmesg | grep CONFIG_EXT4_FS
If the option is enabled, you'll see a line similar to this:
[占位符: 时间戳] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
If the option is not enabled, you won't see any output.
By inspecting the dmesg
output, you can verify the kernel configuration and identify any potential issues related to missing or incorrect configuration options.
Press q
to exit less
.