How do I stop a Linux kernel module from loading automatically?
A module (device driver) is causing Linux server to hang, so we replace Ethernet card with Intel LAN card. The old module still gets loaded. It is causing problem. So I decided to turn off module forever (I am not going to recompile kernel to get rid of this shity module).
The Linux kernel v2.6.xx queries /etc/modules.conf file to load modules for hardware device (old 2.4.xx version uses /etc/modprobe.conf file). If you are using Debian Linux look for /etc/modutils/aliases file.
Just locate name of module and turn it off using following syntax (or add/append line):
alias modulename off
Example
Open file /etc/modules.conf or /etc/modprobe.conf (RHEL 4/5) file:
# vi /etc/modules.conf
Now turn off 8139too module:
alias 8139too off
Read man page of update-modules.modutils/update-modules for more information. I am not sure what to do on Sun Solaris box if such situation popups. If anyone has more info/idea about Sun Solaris UNIX, please add in comments!
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- Howto: Prevent a Linux kernel module from auto loading
- FreeBSD > How to load device driver (module) automatically every time system comes up?
- How to display or show information about a Linux Kernel module or drivers
- FreeBSD Load Device Driver / Kernel Module
- Programming Tutorial: How To Write a FreeBSD Kernel Module ( Driver )
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!



Using Fedora 8 (with upgrades) this does not work. The module loads regardless, when I try to unload it manually, I got a message about not having a module “off” or some such. I’ve also tried removing the alias and adding an install command to remove the module during installation, but that didn’t work either. If you have anymore suggestions, I’d like to hear ‘em.
- Mike