Pages

Apr 24, 2012

get the list and status of device drivers(modules) loaded

The command "lsmod" lists the loaded modules and their status. It prints the content of  /proc/modules file.

#lsmod [-h, -V]

It outputs the following columns:
Module, Size, Used by.
(name of the module; it's size; number of referring modules {use count}and list of referring modules).

Eg:
=====================
# lsmod
Module                  Size  Used by
af_packet              27392  2
======================

To unload a loaded module:

#rmmod [modulename]

rmmod  will  refuse to unload modules which are in use(use count != 0).
 
-w --wait option:  rmmod will isolate  the  module,  and wait  until  the module is no longer used.
-f --force option:  rmmod removes modules which are being used, or which are not designed to be removed
 or have been marked as unsafe. It has no effect unless CONFIG_MODULE_FORCE_UNLOAD was set
 when kernel was compiled.

No comments:

Post a Comment

About Me

My photo
There are a lot of fun things I do and want to do in my life. If you ask me what is the objective of my life, I would say that I want to experience a lot of things so that when I look back from old age I have lot of good memories.... I write this blog to show you a glimpse of what all I do, think, like, wish for etc... Motto: Dream high and work hard to realize it.

views

free counters