Installation guide
212 Chapter 24. Kernel Modules
sunrpc 61328 1 (autoclean) [nfs lockd]
autofs 11264 4 (autoclean)
3c59x 25344 1 (autoclean)
ipchains 38976 0 (unused)
ide-scsi 8352 0
scsi_mod 95104 2 [sr_mod ide-scsi]
ide-cd 26848 0
cdrom 27232 0 [sr_mod ide-cd]
usb-uhci 20720 0 (unused)
usbcore 49664 1 [usb-uhci]
As you can see in Example 24-1, lsmod displays the size, use count, and referring modules
for each module currently loaded.
To load a kernel module, you can use the command /sbin/insmod followed by
the kernel module name. By default, insmod tries to load the module from the
/lib/modules/
kernel-version /kernel/drivers subdirectories. There is a
subdirectory for each type of module, such as the net subdirectory for network interface
drivers. Some kernel modules have module dependencies — other modules must be
loaded first for it to load. To resolve these dependencies, you can either load the module
dependencies and then load the module you want, or you can use the command
/sbin/modprobe followed by the module name to load the module along with its
dependencies.
For example, the command
/sbin/modprobe tulip
loads the tulip network interface module.
To unload kernel modules, use the command /sbin/rmmod followed by the module name.
The rmmod utility will only unload modules that are not in use and that are not a dependency
of other modules in use.
For example, the command
/sbin/rmmod tulip
unloads the tulip network interface module.
Another useful kernel module utility is modinfo. You can use the command /sbin/modinfo
to display information about a kernel module. The general syntax is:
/sbin/modinfo [options]
module
Options include -d that displays a brief description of the module and -p that lists the pa-
rameters the module supports. For a complete list of options, refer to the modinfo man page
(man modinfo).
24.2. Additional Resources
For more information on kernel modules and their utilities, refer to the following resources.
24.2.1. Installed Documentation
• lsmod man page — description and explanation of its output.
• insmod man page — description and list of command line options.