Blacklisting and Auto-Loading Kernel Modules with modprobe.d and modules-load.d
Stop a driver from loading with modprobe.d blacklists, load modules at boot with modules-load.d, set persistent options and update the initramfs.
Published November 27, 2026
Sometimes you need the opposite of automatic driver loading: a buggy Wi-Fi driver keeps crashing, the open-source nouveau driver conflicts with NVIDIA's, or a security baseline requires disabling USB storage. Other times you want a module loaded at boot even though no hardware triggers it. Linux handles both with small configuration files.
The concept
Configuration for modprobe lives in /etc/modprobe.d/*.conf. Each file can contain blacklist lines (do not auto-load this module by alias), install lines (run this command instead of loading), and options lines (default parameters). Files are read in alphabetical order.
A plain blacklist only stops automatic loading through aliases. If another module depends on the blacklisted one, or someone runs modprobe explicitly, it still loads. To block a module completely, add install MODULE /bin/false, which makes any load attempt run /bin/false instead. Loading modules at boot is handled separately by systemd-modules-load, which reads module names from /etc/modules-load.d/*.conf.
Which file does what
| Goal | File | Line |
|---|---|---|
| Stop auto-loading by hardware alias | /etc/modprobe.d/blacklist-foo.conf | blacklist foo |
| Block every load attempt | /etc/modprobe.d/disable-foo.conf | install foo /bin/false |
| Default parameters | /etc/modprobe.d/foo.conf | options foo param=value |
| Load at every boot | /etc/modules-load.d/foo.conf | foo |
| One-off at boot (kernel cmdline) | GRUB_CMDLINE_LINUX | modprobe.blacklist=foo |
Where the blacklist applies
Do not forget the initramfs
Storage, graphics and early drivers are often loaded from the initramfs, a small filesystem the kernel unpacks before mounting the real root. The initramfs contains its own copy of modprobe.d. If you blacklist nouveau but do not rebuild the initramfs, it still loads at boot.
# Debian/Ubuntu
sudo update-initramfs -u
# RHEL/Fedora
sudo dracut --force
# Arch
sudo mkinitcpio -PClassic example: disabling nouveau
Practical examples
Disable USB mass storage (CIS hardening)
Blocks thumb drives while keeping keyboards and mice working.
echo "install usb-storage /bin/false" | sudo tee /etc/modprobe.d/disable-usb-storage.conf
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/disable-usb-storage.conf
sudo modprobe -r usb-storage 2>/dev/null; sudo modprobe usb-storage; echo $? # 1Load modules at boot
Common for br_netfilter and overlay on Kubernetes nodes.
cat <<'EOF' | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo systemctl restart systemd-modules-load
lsmod | grep -E 'overlay|br_netfilter'Emergency blacklist from GRUB
If a driver hangs boot, press e in GRUB and append to the linux line:
linux /vmlinuz-6.8.0-49-generic root=UUID=... ro quiet modprobe.blacklist=nouveauCommon mistakes
- Expecting blacklist alone to block a module that another module depends on.
- Not rebuilding the initramfs, so the change seems to do nothing.
- Putting module names in /etc/modules on systemd distributions that only read /etc/modules-load.d (Debian still honours /etc/modules).
- Blacklisting a storage driver your root filesystem needs and producing an unbootable system.
Key takeaways
- blacklist stops alias-based auto-loading; install foo /bin/false blocks every attempt.
- options lines set persistent default parameters.
- modules-load.d loads modules at boot without any hardware trigger.
- Rebuild the initramfs whenever you change early-boot module configuration.
FAQ
How do I check if a module is blacklisted?
Run modprobe --showconfig | grep -E "blacklist|install" | grep NAME to see the effective configuration.
Does modprobe.blacklist= on the kernel command line persist?
Only if you add it to GRUB_CMDLINE_LINUX in /etc/default/grub and regenerate grub.cfg.
Can I blacklist a built-in driver?
No, blacklisting only affects loadable modules. Built-in drivers can sometimes be disabled with driver-specific kernel parameters or initcall_blacklist=.