Updated: 28 September 2026 · Applies to: kmod 28 to 31 with dracut or initramfs-tools on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13
Sometimes a kernel module must never load: a driver that crashes the machine, a feature you do not want (for example the floppy or usb-storage driver on a server), or one that conflicts with a vendor driver (such as nouveau with the NVIDIA driver). A reliable block has three parts: the blacklist entry, a line that stops other modules from loading it, and a rebuilt initramfs.
Steps
- Check whether it is loaded now:
lsmod | grep -w floppy - Create
/etc/modprobe.d/blacklist-floppy.conf:blacklist floppy install floppy /bin/false
blackliststops automatic loading when the hardware is detected. Theinstallline makes any attempt to load it, including as a dependency of another module, run/bin/falseinstead. - Rebuild the initramfs, so the block also applies early in the boot process:
dracut -f # AlmaLinux, Rocky Linux, RHEL update-initramfs -u # Ubuntu, Debian
- Unload it now, if it is loaded:
modprobe -r floppy(or reboot). - Check after the next reboot:
lsmod | grep -w floppyshould print nothing, andmodprobe floppyshould fail.
Emergency: block it from the boot menu
If the module crashes the server during boot, you cannot log in to create the file. In the GRUB menu, edit the boot entry (see how to change GRUB kernel parameters before booting) and add to the kernel line:
modprobe.blacklist=floppy rd.driver.blacklist=floppy
rd.driver.blacklist applies to the dracut initramfs on AlmaLinux, Rocky Linux and RHEL. Once the system is up, make the block permanent with the steps above.
Undo
Delete the file in /etc/modprobe.d/, rebuild the initramfs again, and load the module with modprobe floppy.
Common problems
- The module still loads: it is built into the kernel (
modinfo floppysays "builtin"), which cannot be blacklisted, or the initramfs was not rebuilt. - The name does not match: use the name
lsmodshows; dashes and underscores are treated the same by modprobe.
For loading modules and setting options, see the beginners guide to kernel module configuration.
Official documentation: modprobe.d manual page and dracut.cmdline manual page.