How Do I Disable a Linux Module?
Contents

You can remove a module from the running kernel with the sudo modprobe -r command. You will get a warning if it’s being used and the module will not be unloaded.

How do you stop a module from loading?

[ step1 ] First we unload the module from the running system if it is loaded. [ step2 ] To prevent a module from being loaded directly you add the blacklist line to a configuration file specific to the system configuration — for example /etc/modprobe.

How do I block a kernel module?

To blacklist a kernel module permanently via GRUB, open the /etc/default/grub file for editing, and add the modprobe. blacklist=MODULE_NAME option to the GRUB_CMD_LINUX command. Then run the sudo grub2-mkconfig -o /boot/grub2/grub. cfg command to enable the changes.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest