kmod
Manage Linux kernel modules
TLDR
List currently loaded kernel modules
Display the static device nodes information provided by the modules of the currently running kernel
SYNOPSIS
insmod module [options]
rmmod module [options]
lsmod
modinfo module
depmod [options]
modprobe module [options]
PARAMETERS
insmod module
Inserts a kernel module into the kernel.
rmmod module
Removes a kernel module from the kernel.
lsmod
Lists the currently loaded kernel modules.
modinfo module
Displays information about a kernel module, such as its author, description, and parameters.
depmod
Generates module dependency lists. This creates a modules.dep file, helping modprobe load dependencies correctly.
modprobe module
Intelligently adds or removes a module from the Linux kernel. Handles dependencies automatically using information generated by depmod.
-f, --force
Force loading/unloading of a module with insmod/rmmod even if it's unsafe.
-r
Used with modprobe to remove a module rather than load it.
DESCRIPTION
The kmod package provides a set of tools for managing Linux kernel modules. These tools allow you to insert, remove, list, and get information about kernel modules. This is crucial for dynamically extending the kernel's functionality without requiring a reboot. Key utilities include insmod, rmmod, lsmod, modinfo, depmod, and modprobe.
The tools offer functionalities like inserting modules (insmod), removing modules (rmmod), listing currently loaded modules (lsmod), displaying module information (modinfo), creating module dependency lists (depmod), and intelligently loading modules and their dependencies (modprobe). modprobe is often preferred as it automatically handles dependencies based on the modules.dep file.
Using these tools requires root privileges. Correct module loading and unloading are essential for system stability. Improper module handling can lead to system crashes or unexpected behavior.
CONFIGURATION FILES
modprobe uses configuration files, typically located in /etc/modprobe.d/, to customize module loading behavior. These files allow you to set module options, alias module names, and blacklist modules.
Example: /etc/modprobe.d/blacklist.conf can be used to prevent certain modules from being loaded.
MODULE DEPENDENCIES
Correct module dependencies are crucial for proper system operation. depmod analyzes modules and creates the modules.dep file, which lists the dependencies for each module. modprobe uses this file to load all necessary modules in the correct order.
HISTORY
The kmod tools evolved from earlier module management utilities. The shift towards modular kernels allowed for dynamic loading and unloading of functionalities. Tools like insmod, rmmod, and lsmod provided basic module handling. depmod and modprobe were developed to address the complexities of module dependencies, making the process more automated and reliable. kmod package aims to consolidate and provide a standard interface for kernel module management. Development focused on improving dependency resolution, error handling, and security.