Linux Kernel Modules 內核模塊管理


Linux 設備驅動以Kernel Module形式存在,Linux Kernel Module可以動態加載到內核中。

 

- lsmod  Show the status of modules in the Linux Kernel

 

- modinfo  Show information about a Linux Kernle module

 

- modprobe  Add and Remove modules from the Linux Kernel

 

示例1:

- 加載ip_vs模塊(重啟后失效)

$ modprobe -v ip_vs
$ lsmod | grep ip_vs
ip_vs                 145497  0 
nf_conntrack          139224  7 ip_vs,nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_conntrack_ipv4,nf_conntrack_ipv6
libcrc32c              12644  4 xfs,ip_vs,nf_nat,nf_conntrack

 

- 卸載ip_vs模塊

$ modprobe -v -r ip_vs

 

- 開機自動加載

// 將模塊加載命令放入 /etc/sysconfig/modules 路徑下
$ cat > /etc/sysconfig/modules/ipvs.modules <<EOF > /sbin/modprobe ip_vs > EOF

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM