36.3.2. Blacklisting a Driver
As described in Section 36.1.2, “Booting into Rescue Mode”, the
rdblacklist kernel option blacklists a driver at boot time. To continue to blacklist the driver on subsequent boots, add the rdblacklist option to the line in /boot/grub/grub.conf that describes your kernel. To blacklist the driver when the root device is mounted, add a blacklist entry in a file under /etc/modprobe.d/.
- Boot the system into rescue mode with the command
linux rescue rdblacklist=name_of_driver, where name_of_driver is the driver that you need to blacklist. Follow the instructions in Section 36.1.2, “Booting into Rescue Mode” and do not choose to mount the installed system as read only. - Open the
/mnt/sysimage/boot/grub/grub.conffile with the vi text editor:vi /mnt/sysimage/boot/grub/grub.conf
vi /mnt/sysimage/boot/grub/grub.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Identify the default kernel used to boot the system. Each kernel is specified in the
grub.conffile with a group of lines that beginstitle. The default kernel is specified by thedefaultparameter near the start of the file. A value of0refers to the kernel described in the first group of lines, a value of1refers to the kernel described in the second group, and higher values refer to subsequent kernels in turn. - Edit the
kernelline of the group to include the optionrdblacklist=name_of_driver, where name_of_driver is the driver that you need to blacklist. For example, to blacklist the driver named foobar:kernel /vmlinuz-2.6.32-71.18-2.el6.i686 ro root=/dev/sda1 rhgb quiet rdblacklist=foobar
kernel /vmlinuz-2.6.32-71.18-2.el6.i686 ro root=/dev/sda1 rhgb quiet rdblacklist=foobarCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file and exit vi.
- Create a new file under
/etc/modprobe.d/that contains the commandblacklist name_of_driver. Give the file a descriptive name that will help you find it in future, and use the filename extension.conf. For example, to continue to blacklist the driver foobar when the root device is mounted, run:echo "blacklist foobar" >> /mnt/sysimage/etc/modprobe.d/blacklist-foobar.conf
echo "blacklist foobar" >> /mnt/sysimage/etc/modprobe.d/blacklist-foobar.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Reboot the system. You no longer need to supply
rdblacklistmanually as a kernel option until you next update the default kernel. If you update the default kernel before the problem with the driver has been fixed, you must editgrub.confagain to ensure that the faulty driver is not loaded at boot time.