[CentOS] How to blacklist a device driver (sysemd)

Fri Nov 17 10:21:27 UTC 2017
James Pearson <james-p at moving-picture.com>

Frank Thommen wrote:
> ** WARNING: This mail is from an external source **
> 
> 
> Hi,
> 
> how can a specific device driver in CentOS 7 be blacklisted, so that it
> doesn't load at boot time?  We have Infiniband adapters which are not
> completely supported by CentOS and we want to silence the error messages
> for the time being.
> 
> I tried with the files
> 
>    /etc/modprobe.d/blacklist
>    /etc/modprobe.d/blacklist.conf
> 
> and with entries
> 
>    mlx5_core
>    mlx5_ib
> 
>    blacklist mlx5_core
>    blacklist mlx5_ib
> 
>    install mlx5_core /dev/null
>    install mlx5_ib /dev/null
> 
> all found on different websites.
> 
> None of these entries helps.  mlx5_core and mlx5_ib are still loaded and
> the system is flooded with error messages.

They are probably being loaded via the initramfs at boot time - i.e. 
before the real root is mounted (where the blacklist entries exist)

I believe you can either add 'rd.driver.blacklist=<driver_name>' to the 
grub2 boot cmdline - or generate a new initramfs (using 'dracut -f -v' - 
make a copy of your current initramfs first) - as this should pull in 
entries in /etc/modprobe.d/

James Pearson