Is there a method enable/disable active kernel module or is there a dist that can disable active kernel modules "on the fly" without reboot ?
- Iam not asking how to blacklist modules.
- Im not asking how to compile own kernel without certain modules.
- Im asking to disable/enable necessary active kernel module without rebooting to disable hardware controlled by the specific module.
I want to use linux instead of windows and for this I need the ability enable/disable hardware such as networkcard, cpu fan, usb ports as I can do in windows. When using modprobe -r -f or rmmod the module is "unlisted" but still used by kernel. I can see the modules is controlled as they are listed/not listed when running the coammnds but as long as kernel is using the module, module is still active in kernel and thereby also the hardware I want to disable when running modprobe -r the module is only hidden from me as user.
Please do not troll this post with posts on blacklisting of modules, custom kernel compiling etc as that is not in scope here. I want the ability to turn hardware on/off and is hoping to use kernel modules or other function to safely disable network cards for an hour or two until sensitive work is done, or disable usb ports and only activate usb when absolutely needed. Yes I can yank the network cable, turn off the wifi router, cut the wires to the usb ports or send my computer into orbit on a rocket outside wifi coverage etc but as linux states it is "safe" Im asking how to disable hardware to achieve that safety.
EDIT : reason for asking for distro is that man pages for rmmod mentions the switch CONFIG_MODULE_FORCE_UNLOAD enabling force unload but need to find a distro with that active.
- Iam not asking how to blacklist modules.
- Im not asking how to compile own kernel without certain modules.
- Im asking to disable/enable necessary active kernel module without rebooting to disable hardware controlled by the specific module.
I want to use linux instead of windows and for this I need the ability enable/disable hardware such as networkcard, cpu fan, usb ports as I can do in windows. When using modprobe -r -f or rmmod the module is "unlisted" but still used by kernel. I can see the modules is controlled as they are listed/not listed when running the coammnds but as long as kernel is using the module, module is still active in kernel and thereby also the hardware I want to disable when running modprobe -r the module is only hidden from me as user.
Please do not troll this post with posts on blacklisting of modules, custom kernel compiling etc as that is not in scope here. I want the ability to turn hardware on/off and is hoping to use kernel modules or other function to safely disable network cards for an hour or two until sensitive work is done, or disable usb ports and only activate usb when absolutely needed. Yes I can yank the network cable, turn off the wifi router, cut the wires to the usb ports or send my computer into orbit on a rocket outside wifi coverage etc but as linux states it is "safe" Im asking how to disable hardware to achieve that safety.
EDIT : reason for asking for distro is that man pages for rmmod mentions the switch CONFIG_MODULE_FORCE_UNLOAD enabling force unload but need to find a distro with that active.
Last edited: