Verify taint details in dmesg
In the previous step, we checked the kernel's taint status using /proc/sys/kernel/tainted
. While that file gives us a numerical code indicating if the kernel is tainted, it doesn't tell us why it's tainted. For more detailed information about kernel messages, including reasons for tainting, we can use the dmesg
command.
The dmesg
command is used to examine the kernel ring buffer. This buffer stores messages from the kernel, including device driver information, errors, and warnings. When the kernel becomes tainted, a message is usually logged in the ring buffer explaining the reason.
Open your terminal if it's not already open.
Now, type the following command and press Enter:
dmesg
This command will output a potentially large amount of text, showing all the kernel messages since the system started.
To find specific information related to tainting, we can combine dmesg
with the grep
command. grep
is a powerful tool for searching text patterns. We'll search for lines containing the word "taint".
Type the following command and press Enter:
dmesg | grep taint
The |
symbol is called a pipe. It takes the output of the command on the left (dmesg
) and sends it as input to the command on the right (grep
). So, this command first gets all the kernel messages and then filters them to show only the lines that contain the word "taint".
If your kernel is not tainted (as expected in this environment), this command might not produce any output. This is normal and indicates that no taint events have been logged.
If the kernel were tainted, you would see lines similar to this (the exact message depends on the reason for tainting):
[ ... ] kernel: Linux version ... (tainted: G)
[ ... ] kernel: Disabling lock debugging due to kernel taint
The (tainted: G)
part indicates the kernel is tainted, and the letter G
specifically means a proprietary module was loaded. Other letters indicate different taint reasons (e.g., P
for proprietary module, F
for forced module loading, R
for restricted license module, etc.).
Using dmesg | grep taint
is a crucial step in diagnosing kernel issues when /proc/sys/kernel/tainted
shows a non-zero value.
Click Continue to move on.