Middle+
What is a Linux kernel module? How to load, unload, and view it?
sobes.tech AI
Answer from AI
A Linux kernel module is a separate object that can be loaded into or unloaded from the kernel dynamically without the need to reboot the system. Modules extend the kernel's functionality, for example, by adding support for new devices or file systems.
The following commands are used to work with modules:
- Load a module:
modprobe <module_name>orinsmod <path_to_module> - Unload a module:
modprobe -r <module_name>orrmmod <module_name> - View loaded modules:
lsmod - View information about a module:
modinfo <module_name>
Example of loading and unloading a module:
sudo modprobe dummy # load the dummy module
lsmod | grep dummy # check if the module is loaded
sudo modprobe -r dummy # unload the module