20
2020
01

使用modprobe命令来添加、删除模块



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

系统环境:Red Hat Enterprise Linux Server release 6.0

[root@localhost huage]# lsmod               //列出当前系统已加载的模块

Module                  Size  Used by

usb_storage            39114  

cdrom                  34035  sr_mod

。。。。。。

。。。。。。

。。。。。。

 

[root@localhost huage]# lsmod |grep usb

usb_storage            39114  

[root@localhost huage]# lsmod |grep usb_storage      

usb_storage            39114  

[root@localhost huage]# lsmod |grep usb-storage

//使用grep过滤输出时,下划线和中划线意义完全不一样

 

[root@localhost huage]# modprobe -r usb_storage     //删除模块;删除模块时需要加‘-r’参数

[root@localhost huage]# lsmod |grep usb

[root@localhost huage]# modprobe usb-storage          //添加模块;添加模块时,直接加模块名就可以了

[root@localhost huage]# lsmod |grep usb

usb_storage            39114  

//使用modprobe命令添加或删除模块时,‘_’‘-’没有区别,即下划线和中划线没有区别

 

[root@localhost huage]# man modprobe

DESCRIPTION(只节选了部分)

       modprobe intelligently adds or removes module  from  the  Linux

       kernel: note that for convenience, there is no difference between

       and in module names.  modprobe looks in the module  directory

       /lib/modules/?.name  -r?. for  all  the  modules and other files,

       except for the optional /etc/modprobe.conf configuration file and

       /etc/modprobe.d  directory  (see modprobe.conf(5)). modprobe will

       also use module options specified on the kernel command  line  in

       the form of <module>.<option>.

-r --remove

              This option causes modprobe to remove rather than insert a

              module. If the modules it depends on are also unused, mod-

              probe  will try to remove them too. Unlike insertion, more

              than one module can be specified on the command  line  (it

              does  not  make  sense  to  specify module parameters when

              removing modules).

 

              There is usually no reason to  remove  modules,  but  some

              buggy  modules  require  it.  Your  kernel may not support

              removal of modules.     


本文链接:https://www.hqyman.cn/post/1165.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: