The modprobe
command is a Linux utility that enables automatic handling of loadable kernel modules. It is used to add or remove modules from the Linux kernel on demand. The modprobe
command is used to load kernel modules into the kernel, and it also resolves dependencies between modules.
Overview
The syntax for the modprobe
command is as follows:
modprobe [options] module_name
The modprobe
command is used to load kernel modules into the kernel. If the module is not already loaded, modprobe
will load it. If the module has dependencies, modprobe
will load those dependencies as well.
Here are some examples of how to use the modprobe
command:
- To load a module:
modprobe module_name
- To remove a module:
modprobe -r module_name
- To show information about a module:
modprobe -c | grep module_name
- To load a module with specific options:
modprobe module_name option1=value1 option2=value2
Options
Here are the available options for the modprobe
command:
Option | Description |
---|---|
-a |
Add the module to the current list of modules. |
-b |
Blacklist the module so that it is not loaded. |
-c |
Print the configuration file that is used to load modules. |
-d |
Use the specified directory to search for modules. |
-r |
Remove the module from the kernel. |
-v |
Display verbose output. |
-V |
Display the version of modprobe . |
Troubleshooting tips
Here are some common issues that users may encounter when using the modprobe
command:
- Module not found: If
modprobe
cannot find the module, make sure that the correct module name is being used. Use themodinfo
command to verify the module name. - Dependency issues: If
modprobe
fails to load a module due to missing dependencies, use thedepmod
command to regenerate the module dependency tree. - Permission issues: If
modprobe
fails due to insufficient permissions, run the command as root or with sudo privileges.
Notes
- The
modprobe
command is typically used during system startup to load required kernel modules. - The configuration file used by
modprobe
is located at/etc/modprobe.conf
or/etc/modprobe.d/*.conf
. - The
modprobe
command is often used in conjunction with other commands such aslsmod
andinsmod
.