What it does
modprobe NAME loads a module and everything it needs; modprobe -r NAME removes it and unused dependencies. Parameters can be given on the command line (modprobe loop max_part=8) or in /etc/modprobe.d/*.conf with options. In the same folder blacklist and install … /bin/false stop modules from loading.
Modules that must load at boot go in /etc/modules-load.d/*.conf.
How to write it
modprobe [OPTION]... MODULE [PARAMETER=VALUE]...
modprobe -r [OPTION]... MODULE...
modprobe -cOptions 20
Most used
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1Load a module
fat is loaded too (dependency).
2Unload it
modprobe -r vfatFails if it is in use.
3Load with a parameter
modprobe loop max_part=8Only until the module is unloaded or reboot.
4Parameter for good
echo "options loop max_part=8" > /etc/modprobe.d/loop.confUsed every time the module loads.
5Load at boot
echo vfat > /etc/modules-load.d/vfat.confsystemd-modules-load reads this folder.
6Block a module (hardening)
printf 'blacklist usb-storage\ninstall usb-storage /bin/false\n' > /etc/modprobe.d/no-usb-storage.confblacklist stops auto-loading; install /bin/false stops modprobe too.
7Test what would happen
modprobe -nv vfat insmod /lib/modules/…/fat.ko.xz insmod /lib/modules/…/vfat.ko.xzNo change.
8Show the active configuration
modprobe -c | grep -E '^(options|blacklist)'All options and blacklists from all files.
9Which module serves an alias
modprobe -R pci:v00008086d000010D3sv*sd*bc*sc*i*Hardware ID to module name.
10Rebuild the initramfs after changes for early modules
dracut -fBlacklists of storage drivers must be in the initramfs too.
Nothing matches this filter.
Files
/etc/modprobe.d/*.conf- options, blacklist, install, alias lines.
/etc/modules-load.d/*.conf- Modules to load at boot.
/lib/modules/$(uname -r)/- The module files.
Exit codes
0 :: Done. 1 :: Error.