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!


🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • sai prasad Apr 26, 2013 @ 16:03

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

  • Michael Ward Dec 24, 2007 @ 3:37

    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

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz