如何在关闭某个内核模块

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

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

[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. NGINX Gateway Fabric 2.8: IP allow and deny lists, passive health checks, and cookie-based session persistence (2026-11-14 01:10:02)
  2. NGINX Ingress Controller 5.7: HTTP/2 to your upstreams, Opaque Secrets, and cert-manager challenges behind HTTPS redirects (2026-11-14 00:10:02)
  3. Hexo 文章一键发布到微信公众号 (2026-11-13 19:10:02)

查看更多 DevOps 文章 →

建议继续学习

  1. Linux如何统计进程的CPU利用率 (累计阅读 16,952)
  2. 我的 RHCA 之路 (累计阅读 14,366)
  3. Linux内存点滴 用户进程内存空间 (累计阅读 13,953)
  4. 给程序员新手的一些建议 (累计阅读 13,515)
  5. Linux 性能监控、测试、优化工具 (累计阅读 13,458)
  6. 关于linux内存free的一些事情 (累计阅读 13,398)
  7. Google怎么用linux (累计阅读 13,157)
  8. ps - 按进程消耗内存多少排序 (累计阅读 12,981)
  9. Linux Used内存到底哪里去了? (累计阅读 12,523)
  10. find命令的一点注意事项 (累计阅读 12,367)