$ run as a normal user# run as root (or with sudo)
The quick answer
Step by step
- Is it loaded? (line 1) —
lsmodlists loaded modules. Info about a module, its options and file:modinfo br_netfilter. - Load it now (line 2) —
modprobealso loads modules it depends on. - Load it at every boot (lines 3–4) — one module name per line in
/etc/modules-load.d/NAME.conf;systemd-modules-loadreads these files at boot. - Module options — for example a driver parameter:
options bonding max_bonds=0Options apply when the module is loaded; reload the module (modprobe -r then modprobe) or reboot.
- Block a module (hardening, for example no USB storage):
blacklist usb-storage
install usb-storage /bin/falseblacklist stops automatic loading; the install … /bin/false line also stops a manual modprobe usb-storage.
- Early boot — if the module is needed before the root file system is mounted (storage drivers), rebuild the initramfs after the change:
dracut -f(RHEL) orupdate-initramfs -u(Debian/Ubuntu). - Unload —
modprobe -r MODULE(fails while in use;lsmodshows the "Used by" count).
Check that it worked
After a reboot lsmod | grep -E 'overlay|br_netfilter' lists both; systemctl status systemd-modules-load shows no errors; modprobe usb-storage fails (exit code 1) on the hardened server.
Common problems
| Problem | Cause | Fix |
|---|---|---|
Module X not found in directory /lib/modules/… | Not built for this kernel, or kernel updated without reboot. | Install the module package for the running kernel; reboot after kernel updates. |
| Module not loaded after reboot | File not ending in .conf, or a typo. | systemctl status systemd-modules-load; fix the name. |
Key was rejected by service | Secure Boot blocks an unsigned module. | Use signed modules (distribution packages) or enroll your key. |
| Blacklisted module still loads | Another module depends on it, or loaded from the initramfs. | Add install … /bin/false; rebuild the initramfs. |
| Options ignored | Module was already loaded. | Reload the module or reboot. |
modprobe: FATAL: … in use | Something uses the module. | Stop the user (interface, mount) first. |
Go further
- Command pages: modprobe, lsmod, modinfo, dracut.
- Next how-tos: Change kernel settings with sysctl, Connect two servers with a WireGuard VPN, Upgrade a kubeadm cluster, Patch a server with security updates.
- Learn it: RHCSA — Kernel modules, RHCSA — Module parameters, RHCSA — initramfs.
1Where do you list modules that must load at every boot?
In a .conf file in /etc/modules-load.d/, one module name per line.
2Why add install MODULE /bin/false besides blacklist?
blacklist only stops automatic loading; the install line also blocks loading by hand or as a dependency.