Data Networking Blog
Blog for Admins

RHCSA – Kernel Modules


Linux Kernel has a modular design where modules can be plugged in and out if and when required. So, if we plug in a new hardware that requires a driver, a relevant module is automatically loaded to the Kernel. If a module is not being used anymore then it may be unloaded automatically. udev is responsible for monitoring hardware changes.

You can view a list of currently loaded kernel modules using lsmod.

The output shows the name of the module, it’s size and how many other modules are dependent on it in the used by field. And in most cases it also displays a list of modules that depend on it. To load/unload a module manually the modprobe command can be used.

The modprobe -r in the example above is unload/removing the module. There is another utility insmod that can be used to do the same but it does not take care of any dependencies automatically where as modeprobe loads all dependencies automatically.

Every module may also have certain parameters that can be configured. To check the available parameters and other information you can view details about a module using the modinfo command.

With modinfo we can see details about a particular module. This also shows parm: fields which are names of parameters that this module understands along with the type of value it accepts. So in the output above we can see a parameter named debug that accepts boolean values (true/false, 1/0). We can change these values using the modprobe command.

This changes the value of the param debug to 1 but it won’t be presistent across reboots. Another way that makes changes permanent is to use the snap in directory /etc/modprobe.d/. In this directory create a .conf file with the same name as the module.

This change will now remain even after a reboot.



July 27, 2017 Uncategorised Jd
Font Size
Decrease Size Default Size Increase Size
Select Skin
Select Underlay Background
Select Overlay Background
Scheme Switcher Toggle