modprobe Command in Linux: Load and Manage Kernel Modules

The Linux kernel is the core component of the Linux operating system. It manages the system’s resources and acts as a bridge between your computer’s hardware and software.
The Linux kernel has a modular design. A kernel module, often referred to as a driver, is a piece of code that extends the kernel’s functionality. Modules are either compiled as loadable modules or built into the kernel. Loadable modules can be loaded and unloaded in the running kernel on request, without the need to reboot the system.
Generally, modules are loaded on demand by udev (the device manager). However, sometimes you may need to fine-tune how modules are loaded. For example, you may need to load a module with additional parameters or prevent a module from loading automatically.
You can manually load a module into the kernel using the modprobe command, or automatically at boot time using /etc/modules-load.d/*.conf files. modprobe is part of kmod, a package that implements multiple utilities for managing Linux kernel modules.
This guide explains how to use modprobe to load, unload, blacklist, and configure kernel modules.
Syntax
The general syntax for the modprobe command is:
modprobe [OPTIONS] module_name [parameter=value ...]Common options:
-r— Remove (unload) a module from the kernel-v— Verbose mode, show each step as modules are loaded or unloaded-n— Dry run, do everything except actually load or unload the module-c— Show the current modprobe configuration--show-depends— List the dependencies of a module without loading it--first-time— Fail if the module is already loaded (useful in scripts)
Loading Kernel Modules
Kernel modules are stored in the /lib/modules/<kernel_version> directory. You can find the version of the running kernel
with the uname -r
command.
Only users with administrative privileges can manage kernel modules.
To load a module, invoke modprobe followed by the module name:
sudo modprobe module_namemodprobe loads the given module and any dependencies it requires. Only one module can be specified per command.
Use the lsmod
command to confirm that the module is loaded:
lsmod | grep module_nameTo see exactly what modprobe does when loading a module, add the -v (verbose) flag:
sudo modprobe -v module_nameIf you want to test whether a module can be loaded without actually loading it, use the -n (dry run) option together with -v:
sudo modprobe -n -v module_nameLoading Modules with Parameters
Some modules accept parameters that change their behavior. To load a module with parameters, pass them as parameter=value pairs after the module name:
sudo modprobe module_name parameter=valueThe command accepts multiple parameter=value pairs separated by spaces.
To see what parameters a module supports, use modinfo:
modinfo -p module_nameMaking Parameters Persistent
To set module parameters that apply every time the module is loaded, create a configuration file in /etc/modprobe.d/. Files must end with .conf and can have any name:
options module_name parameter=valueFor example, to always load the snd_hda_intel sound module with power_save=1:
options snd_hda_intel power_save=1The settings in /etc/modprobe.d/ are read by modprobe every time the module is loaded, whether manually or at boot.
Loading Modules at Boot
To load a module automatically at boot time, add its name to a file in /etc/modules-load.d/. Each file lists one module name per line:
br_netfilter
vhost_netThese files are read by systemd-modules-load during startup. They only specify which modules to load; for parameters, use a separate file in /etc/modprobe.d/ as described above.
Removing Kernel Modules
To unload a module, invoke modprobe with the -r option followed by the module name:
sudo modprobe -r module_namemodprobe will also remove any module dependencies that are no longer in use.
When invoked with -r, the command accepts multiple modules as arguments:
sudo modprobe -r module_name1 module_name2rmmod
command to unload a module from the Linux kernel. The difference is that rmmod only removes the specified module, while modprobe -r also removes unused dependencies.Blacklisting Modules
If you want to prevent a kernel module from loading at boot time, you can blacklist it. Create a .conf file inside the /etc/modprobe.d/ directory:
blacklist module_nameIf you want to blacklist multiple modules, add each one on a new line, or create separate .conf files.
To verify that the rule is in effect, run modprobe in dry-run mode with verbose output:
sudo modprobe -n -v module_nameAfter blacklisting a module, rebuild the initramfs so the change takes effect on the next boot:
sudo update-initramfs -uOn Fedora, RHEL, and Derivatives, use dracut instead:
sudo dracut --forcesudo modprobe module_name or pulled in as a dependency of another module. To completely prevent loading, add install module_name /bin/false to the blacklist file.Listing and Inspecting Modules
To list all currently loaded modules, use lsmod
:
lsmodTo view detailed information about a specific module (including its description, author, license, parameters, and file path), use modinfo:
modinfo module_nameFor example, to inspect the br_netfilter module:
modinfo br_netfilterfilename: /lib/modules/6.8.0-51-generic/kernel/net/bridge/br_netfilter.ko
description: Linux ethernet netfilter bridge
author: Lennert Buytenhek <buytenh@gnu.org>
license: GPL
depends: bridge
retpoline: Y
intree: Y
name: br_netfilter
vermagic: 6.8.0-51-generic SMP preempt mod_unload modversionsTo list only the parameters a module accepts:
modinfo -p module_namePractical Examples
Loading br_netfilter for Container Networking
Kubernetes and Docker require the br_netfilter module so that iptables rules apply to bridged traffic. To load it and make it persistent:
sudo modprobe br_netfilterbr_netfilterBlacklisting the Nouveau Driver
When installing the proprietary NVIDIA driver, you need to blacklist the open-source nouveau driver to prevent conflicts:
blacklist nouveau
options nouveau modeset=0Then rebuild the initramfs and reboot:
sudo update-initramfs -u
sudo rebootChecking Module Dependencies Before Loading
To see what dependencies a module requires without loading anything:
modprobe --show-depends vboxdrvThis is useful for debugging when a module fails to load due to missing dependencies.
Quick Reference
| Task | Command |
|---|---|
| Load a module | sudo modprobe module_name |
| Load with parameters | sudo modprobe module_name param=value |
| Unload a module | sudo modprobe -r module_name |
| Dry run (test without loading) | sudo modprobe -n -v module_name |
| Show module dependencies | modprobe --show-depends module_name |
| Show modprobe configuration | modprobe -c |
| List loaded modules | lsmod |
| View module info | modinfo module_name |
| Blacklist a module | echo 'blacklist module_name' >> /etc/modprobe.d/blacklist.conf |
| Load at boot | Add module name to /etc/modules-load.d/*.conf |
Troubleshooting
“Module module_name not found”
The module does not exist for the running kernel version. Verify you are looking for the correct name with find /lib/modules/$(uname -r) -name '*.ko*' | grep keyword. On Ubuntu, you may need to install the linux-modules-extra-$(uname -r) package.
“modprobe: ERROR: could not insert module: Operation not permitted”
Loading modules requires root privileges. Run the command with sudo.
“modprobe: FATAL: Module module_name is in use”
The module cannot be unloaded because other modules or processes depend on it. Run lsmod | grep module_name to see what is using it. Unload the dependent modules first, or stop the processes that hold references to the module.
Module loads manually but does not persist across rebootmodprobe only loads a module for the current session. To make it persistent, add the module name to a file in /etc/modules-load.d/ as described in the Loading Modules at Boot
section.
Module is blacklisted but still loads
A blacklist entry only prevents automatic loading by udev. If another module depends on the blacklisted module, it will still be loaded. Add install module_name /bin/false to the blacklist file to completely block it, then rebuild the initramfs.
FAQ
What is the difference between modprobe and insmod?insmod loads a single module file by its full path and does not resolve dependencies. modprobe loads a module by name, automatically resolves and loads all dependencies, and reads configuration from /etc/modprobe.d/. In practice, modprobe is almost always the better choice.
How do I check if a kernel module is loaded?
Run lsmod | grep module_name. If the command produces output, the module is loaded. You can also check /proc/modules directly.
How do I permanently load a module at boot?
Add the module name (one per line) to a .conf file in /etc/modules-load.d/. For module parameters, create a separate file in /etc/modprobe.d/ with options module_name parameter=value.
How do I undo a blacklist?
Remove or comment out the blacklist module_name line from the file in /etc/modprobe.d/, then rebuild the initramfs with sudo update-initramfs -u (or sudo dracut --force on Fedora/RHEL) and reboot.
Conclusion
The modprobe command loads and unloads kernel modules along with their dependencies, while /etc/modprobe.d/ and /etc/modules-load.d/ handle persistent configuration and boot-time loading. For related commands, see lsmod
for listing loaded modules and rmmod
for removing individual modules.
Tags
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page