How do I stop a Linux kernel module from loading automatically?

by on March 30, 2006 · 2 comments· LAST UPDATED April 30, 2007

in , ,

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!

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 Michael Ward December 24, 2007 at 3:37 am

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

Reply

2 sai prasad April 26, 2013 at 4:03 pm

How do we come to know which module is causing for server hung.

Reply

Leave a Comment

Previous post:

Next post: