Preventing Modules From Loading at Boot Time

You can prevent modules from loading at boot time by adding a deny rule in a configuration file in the /etc/modprobe.d directory and then rebuilding the initial ramdisk used to load the kernel at boot time.

WARNING:

Disabling modules can have unintended consequences and can prevent a system from booting or from being fully functional after boot. As a best practice, create a backup ramdisk image before making changes and ensure that the configuration is correct.

  1. Create a configuration file to prevent the module from loading.

    For example:

    sudo tee /etc/modprobe.d/bnxt_en-deny.conf <<'EOF'
    #DENY bnxt_en
    blacklist bnxt_en
    install bnxt_en /bin/false
    EOF
  2. Rebuild the initial ramdisk image.
    sudo dracut -f -v
  3. Reboot the system for the changes to take effect.
    sudo reboot