Site icon New Generation Enterprise Linux

Stop the kernel from guessing which module you actually want

Kernel News & Module Management

Stop the kernel from guessing which module you actually want

Technical Briefing | 12/3/2026

Most of the time, modprobe does the right thing. You ask for a filesystem or a driver, it looks at modules.alias, and the kernel hums along happily. But every now and then, you run into an ambiguity where the kernel decides it knows better than you do, and it loads a driver that matches the ID but isn’t what you intended. I once spent four hours debugging why a legacy RAID controller was hijacking my NVMe devices simply because the module aliases overlapped on a generic PCI ID. It is a quiet, frustrating way to lose a Saturday.

Why aliases lie to you

The kernel builds a massive lookup table generated during the build process. When you run modprobe, it consults /lib/modules/$(uname -r)/modules.alias. If you have two drivers claiming the same hardware alias, the kernel loader effectively picks the first one it finds in that text file. It is not always deterministic, especially when you have custom kernels or legacy modules hanging around from older versions. Stop trusting the auto-loader blindly when you are working on specialized hardware.

modprobe -n -v your_module_name
  • The -n flag performs a dry run so you can see exactly which file will load without touching the state of the system.
  • The -v flag reveals the dependency chain, which often highlights why a random extra module is getting pulled in unexpectedly.
  • Checking modules.alias directly is faster than grep-ing through logs after the system fails to boot.

Take the keys back from modprobe

If you are tired of the kernel misidentifying your hardware, use /etc/modprobe.d/ to pin the module you actually want. You can use the install directive to tell the kernel to run /bin/true instead of loading a specific module, effectively blacklisting it globally without having to dig through kernel parameters. If a device is repeatedly pulling the wrong module, blacklisting the bad actor there is the only way to sleep soundly. Don’t let the system decide for you when you know the hardware better than it does.

Next time a driver starts behaving like it has a mind of its own, check the alias file before you go tearing apart your config. Usually, the truth is sitting right there in the text, waiting for someone to actually read it.

Linux Admin Automation  |  © www.ngelinux.com  |  12/3/2026
0 0 votes
Article Rating
Exit mobile version