Disabling Linux Device
There is two ways to disable a device on Linux, at boot time and at runtime:
- Execute:
sudo lspci -k
- Find the device you are trying to disable and search for the
Kernel modules:
line.
Both of this steps work for Boot time and runtime
At Boot Time
- Use the command:
lsmod | grep <kernel_module>
to see if the module is enabled first. - Blacklist the kernel module creating a
/etc/modprobe.d/blacklist.conf
file. - Inside the file, write one line containing
blacklist <kernel_module>
, replacing<kernel_module>
by the kernel module you want to disable. - Regenerate the initramfs using the following command:
- In Arch Linux:
sudo mkinitcpio -P
- In Debian:
sudo depmod -ae
update-initramfs -u
- Reboot
- Verify that the module has been removed by running:
lsmod | grep <kernel_module>
. If the module is no longer listed, the module has been disabled and the device will be ignored by the Linux kernel.
At Runtime
- Use the command:
lsmod | grep <kernel_module>
to see if the module is enabled first. - Use the command:
sudo modprobe -r <kernel_module>
to disable the module. - Verify that the module has been removed by running:
lsmod | grep <kernel_module>
. If the module is no longer listed, the module has been disabled and the device will be ignored by the Linux kernel.