Updated: 28 September 2026 · Applies to: kmod 28 to 31 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10; Ubuntu 24.04 and 26.04; Debian 13

Kernel modules are pieces of the Linux kernel that load when needed: drivers for network cards and disks, file systems, firewall features and more. You rarely have to touch them, but when a driver misbehaves or a feature needs an option, these are the tools. They all come from the kmod package, which is installed on every system.

1. See what is loaded

lsmod
lsmod | grep xfs

The columns are the module name, its size and "Used by": how many users it has and which other modules depend on it. A module in use cannot be unloaded.

2. Get information about a module

modinfo e1000e

This shows the file, description, license, dependencies and the options (parm: lines) the module accepts. The options a loaded module is currently using are in /sys/module/NAME/parameters/.

3. Load and unload a module

modprobe br_netfilter        # load, with its dependencies
modprobe -r br_netfilter     # unload

Use modprobe, not insmod or rmmod: it resolves dependencies and reads your configuration. Changes last until the next reboot.

4. Load a module at every boot

Create a file in /etc/modules-load.d/ with one module name per line:

echo br_netfilter > /etc/modules-load.d/br_netfilter.conf

The systemd-modules-load service reads these files at boot. Check it with systemctl status systemd-modules-load.

5. Set module options

Put options in a file in /etc/modprobe.d/:

echo "options bonding max_bonds=2" > /etc/modprobe.d/bonding.conf

They apply the next time the module loads: unload and load it again, or reboot.

6. Stop a module from loading

cat > /etc/modprobe.d/blacklist-floppy.conf <<'EOF'
blacklist floppy
install floppy /bin/false
EOF

blacklist stops automatic loading by hardware detection; the install line also stops other modules from pulling it in.

7. Update the initramfs when needed

Some modules load before the root file system is mounted, from the initramfs. After blacklisting a storage or graphics driver, or changing its options, rebuild the initramfs so the change applies at boot:

dracut -f                 # AlmaLinux, Rocky Linux, RHEL
update-initramfs -u       # Ubuntu, Debian

Common problems

  • "Module not found in directory /lib/modules/...": the module is not built for the running kernel. Check uname -r; after a kernel update, reboot into the new kernel, or install the driver package for this kernel version.
  • "Key was rejected by service": Secure Boot only allows signed modules. Use a signed driver package from your distribution or vendor.
  • "Module is in use" when unloading: stop what uses it first (see the "Used by" column in lsmod).

Official documentation: modprobe manual page and modprobe.d manual page.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (52 Votes)