Interview Prep/Linux/Boot Process & Kernel

How do you blacklist a kernel module?

IntermediateConceptBoot Process & Kernel
Answer

In one line: To blacklist a kernel module means to stop it from loading automatically. You do it with a config file in /etc/modprobe.d/.

Example — stop the nouveau graphics driver (common before installing NVIDIA drivers on a GPU server):

echo "blacklist nouveau" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u      # Ubuntu/Debian — also update the initramfs
sudo dracut -f                # RHEL/Rocky
sudo reboot

Important detail: blacklist only stops automatic loading. The module can still load if another module needs it or someone runs modprobe manually. To block it completely:

echo "install usb-storage /bin/false" | sudo tee /etc/modprobe.d/no-usb-storage.conf

This makes any attempt to load usb-storage run /bin/false instead, so the module never loads — a common security hardening step to block USB drives on servers.

Check it worked: after a reboot, lsmod | grep nouveau should print nothing.

All Linux questions Roadmap: Linux

More on Boot Process & Kernel