How to disable/unload some driver for your current session without restarting ?
If the driver is a Loadable Kernel Module (LKM) then you are in luck, (Drivers are LKMs most of the times, don't worry :) )
all you have to do is
$modprobe -r <module name>
What if you want to disable module across reboots without re-running above command ?
In this case you can blacklist the module. To do it, add following line
blacklist <module name>
to
/etc/modprobe.d/blacklist.conf
file.
Be sure to use sudo or root privilege for modifying the file, else you will not be allowed to modify it.
Blacklisting modules can be very useful, sometimes for disabling misbehaving modules or sometimes for disabling unnecessary modules, like floppy drivers (I don't see a computer that still has floppy drive!).
Lets assume that you removed/unloaded a module in current session, what if you want to load it back for what-so-ever reason. I have one reason, one of my driver misbehaves sometimes, unloading and loading it back helps fixing it rather than restarting my machine, though this may not be the best solution, this is the easiest one that I have found so far!
run following command to re-load module. (This command inserts the module).
$modprobe <module name>
for more info on modprobe, use man pages, they are always very good source of information.
You can also replace your old drivers with new ones without restarting your computer
$modprobe -r <old module>
$modprobe <newmodule>
If the driver is a Loadable Kernel Module (LKM) then you are in luck, (Drivers are LKMs most of the times, don't worry :) )
all you have to do is
$modprobe -r <module name>
What if you want to disable module across reboots without re-running above command ?
In this case you can blacklist the module. To do it, add following line
blacklist <module name>
to
/etc/modprobe.d/blacklist.conf
file.
Be sure to use sudo or root privilege for modifying the file, else you will not be allowed to modify it.
Blacklisting modules can be very useful, sometimes for disabling misbehaving modules or sometimes for disabling unnecessary modules, like floppy drivers (I don't see a computer that still has floppy drive!).
Lets assume that you removed/unloaded a module in current session, what if you want to load it back for what-so-ever reason. I have one reason, one of my driver misbehaves sometimes, unloading and loading it back helps fixing it rather than restarting my machine, though this may not be the best solution, this is the easiest one that I have found so far!
run following command to re-load module. (This command inserts the module).
$modprobe <module name>
for more info on modprobe, use man pages, they are always very good source of information.
You can also replace your old drivers with new ones without restarting your computer
$modprobe -r <old module>
$modprobe <newmodule>
No comments:
Post a Comment