I would like to temporarily (until next boot) disable a kernel module.
How can I do this?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI would like to temporarily (until next boot) disable a kernel module.
How can I do this?
Use lsmod
to find the name of a kernel module about that you are interested in temporarily disabling. After you've found the name, use this command to disable the module:
sudo modprobe -r <module_name>
However, this command will fail with an error message something like FATAL: Module <module_name> is in use
if a process is using:
<module_name>
<module_name>
directly depends on<module_name>
- through the dependency tree - depends on indirectly.You can use lsmod | grep <module_name>
to obtain the names of the modules which are preventing you from temporarily disabling a certain module (these module names are listed in the last column).
More about:
FATAL: Module g_serial is builtin.
error.
Jun 16, 2015 at 13:12
It appears:
sudo modprobe -r moduleName
Achieves what I want. The module is removed and reloaded upon reboot.