6.2 Listing Information about Loaded Modules

Use the lsmod command to list the modules that are currently loaded into the kernel.

# lsmod
Module                  Size  Used by
nls_utf8                1405  1 
fuse                   59164  0 
tun                    12079  0  
autofs4                22739  3 
...
ppdev                   7901  0 
parport_pc             21262  0 
parport                33812  2 ppdev,parport_pc
...
Note

This command produces its output by reading the /proc/modules file.

The output shows the module name, the amount of memory it uses, the number of processes using the module and the names of other modules on which it depends. In the sample output, the module parport depends on the modules ppdev and parport_pc, which are loaded in advance of parport. Two processes are currently using all three modules.

To display detailed information about a module, use the modinfo command, for example:

# modinfo ahci
filename:       /lib/modules/2.6.32-300.27.1.el6uek.x86_64/kernel/drivers/ata/ahci.ko
version:        3.0
license:        GPL
description:    AHCI SATA low-level driver
author:         Jeff Garzik
srcversion:     AC5EC885397BF332DE16389
alias:          pci:v*d*sv*sd*bc01sc06i01*
...
depends:        
vermagic:       2.6.32-300.27.1.el6uek.x86_64 SMP mod_unload modversions 
parm:           skip_host_reset:skip global host reset (0=don't skip, 1=skip) (int)
parm:           ignore_sss:Ignore staggered spinup flag (0=don't ignore, 1=ignore) (int)
...

The output includes the following information:

filename

Absolute path of the kernel object file.

version

Version number of the module.

description

Short description of the module.

srcversion

Hash of the source code used to create the module.

alias

Internal alias names for the module.

depends

Comma-separated list of any modules on which this module depends.

vermagic

Kernel version that was used to compile the module, which is checked against the current kernel when the module is loaded.

parm

Module parameters and descriptions.

Modules are loaded into the kernel from kernel object (ko) files in the /lib/modules/kernel_version/kernel directory. To display the absolute path of a kernel object file, specify the -n option, for example:

# modinfo -n parport
/lib/modules/2.6.32-300.27.1.el6uek.x86_64/kernel/drivers/parport/parport.ko

For more information, see the lsmod(5) and modinfo(8) manual pages.