Stop your kernel modules from auto-loading ghosts you don’t need
Technical Briefing | 7/27/2026
You probably think the modules loaded in your kernel are there because you explicitly wanted them or because some dependency chain required them. Most of the time that is true, but modprobe is essentially a black box that loves to grab extra drivers based on hardware aliases you might not even be using. I once spent four hours chasing a networking hiccup only to realize an obscure NIC driver was being pulled in by an alias that had nothing to do with the actual hardware present.
Why modprobe gets too excited
The kernel uses aliases to map hardware identifiers to specific modules. When you trigger a coldplug or a daemon watches udev, the kernel asks modprobe to fetch the driver. But here is the kicker: modprobe often has multiple matches for a single alias. It loads them all. If you have a dev box that sees a bunch of virtual devices, you are likely bloating your kernel memory with drivers for hardware you will never plug into that machine.
grep -r . /etc/modprobe.d/ /lib/modprobe.d/ | grep -v 'install' | grep 'alias' | grep -v 'blacklist'
- Check your current loaded modules with lsmod to identify the cruft
- Use modprobe –show-depends to see exactly what is triggering a load
- Create a blacklist file in /etc/modprobe.d/ to explicitly stop unwanted drivers
- Verify your changes persist across reboots by checking the output of sysctl modules
Taming the kernel behavior
The right approach is to treat your /etc/modprobe.d/ directory like your server config. Don’t just let the system dump modules there during package installs. If you see something weird in dmesg, look at what triggered the load request. If you stop the bleeding early, you won’t have to guess why your memory footprint looks so bloated after a routine kernel update.
Next time you feel like the system is acting sluggish, run an lsmod and count the modules that you actually recognize. If you don’t know what it does, and you aren’t using the hardware, kill the module. Your kernel will be faster and a hell of a lot more predictable.
