IT技术博客大学习 共学习 共进步

如何在关闭某个内核模块

MySQL 中文网 - 2010-10-25 09:10:53 浏览 3,144 次

有些时候,我们并不需要一些特殊的模块,或者个别模块对我们的硬件支持不是那么好,这就需要在内核将它们关闭,编辑下述文件即可:

以下是代码片段:

[root@imysql.cn ]# cat /etc/hotplug/blacklist
#
# Listing a module here prevents the hotplug scripts from loading it.
# Usually that’d be so that some other driver will bind it instead,
# no matter which driver happens to get probed first.  Sometimes user
# mode tools can also control driver binding.
#
# Syntax:  driver name alone (without any spaces) on a line. Other
# lines are ignored.
#
#diasble usb_storage
usb_storage
#disable edac
i5000_edac
edac_mc

只需要往 /etc/hotplug/blacklist中添加一行,然后重启系统即可生效。
上面的方法适用于AS4的系统,但如果是AS5的系统,方法就不一样了,编辑/etc/modprobe.conf,内容类似:

以下是代码片段:

[root@imysql.cn ]# cat /etc/modprobe.conf
alias eth0 bnx2
#disable lists
alias power_meter off
alias hwmon off

同样地,重启系统即可。
如果想立刻生效,也可以执行rmmod命令,但个别内核模块删除后,报错信息仍然继续产生,想要彻底清净的话,就参照上述方法吧。

建议继续学习

  1. 在Apache2.2.XX下安装Mod-myvhost模块 (阅读 12,906)
  2. Nginx模块开发入门 (阅读 11,042)
  3. nginx模块开发 (阅读 5,603)
  4. CommonJS 的模块系统,AMD 和 Wrappings, 以及 RequireJS (阅读 5,164)
  5. FarmVille(美版开心农场)谈架构:所有模块都是一个可降级的服务 (阅读 4,363)
  6. 搭好了apache模块的开发环境 (阅读 4,365)
  7. PHP 模块编写需要注意的一个问题---- php模块及函数名都定义成小写吧 (阅读 4,303)
  8. 使用 Perl 来开发 Nginx 的模块 (阅读 4,043)
  9. php无法加载pcre.so的解决办法 (阅读 3,844)
  10. Perl的English模块 (阅读 3,584)