• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

Modprobe Command in Linux

Written by Admin, Updated On October 3, 2020
terminal
Modprobe Command in Linux

The Linux kernel is managing the computer resources and work as the bridge between your computer’s hardware and software. It is the core component in the Linux operating system. The Linux kernel has a modular design and need to add and remove modules. In this article, we’ll explain how to use modprobe to add and remove modules from the Linux kernel.

Kernel modules are either compiled as loadable modules or built into the kernel. Loadable modules can be loaded and unloaded in the running kernel on request, without the need to reboot the system. Generally, the modules are loaded on demand by udev. You can manually load a module into the kernel using the modprobe command, or automatically at boot time using /etc/modules or /etc/modules-load.d/*.conf files.

Add Kernel Modules#

The Kernel modules are located in the /lib/modules/ directory. Find the version of running kernel using the uname -r command.

Run the following modprobe command followed by module name to load:

modprobe MODULE_NAME

The modprobe command will load the given module and any additional module dependencies. Only one module can be specified at the command line.

You can confirm module by using lsmod command:

lsmod | grep MODULE_NAME

To load a module with additional parameters, use the parameter=value syntax:

modprobe MODULE_NAME parameter=value

You can pass the multiple parameter=value pairs separated by space with modprobe command:

Generally, you would need to load the module during the system boot. You can do that by that by specifying the module and its parameters in a file inside the /etc/modules-load.d directory. Files must end with .conf and can have any name:

Commonly, it’s require to load the modules at the time of system boot. You can specify the module and its parameter in a file at /etc/modules-load.d directory with name like /etc/modules-load.d/MODULE_NAME.conf.

option MODULE_NAME parameter=value

The udev (device manager) will read the settings and which loads the modules at system startup using modprobe.

Remove Kernel Modules#

It is very simple to remove the module. Run the modprobe command with -r option followed by the module name:

modprobe -r module_name

It will also remove the unused module dependencies.

You can also remove multiple modules in a single command by specifying multiple modules as arguments:

modprobe -r module_name1 module_name2

To prevent a Kernel module from loading at boot time, create a .conf file with any name inside the /etc/modprobe.d. The syntax is:

blacklist module_name

If you want to blacklist additional modules, specify the modules on a new line, or create a new .conf file.

Conclusion#

The modprobe command is used to add and remove the Linux kernel modules on Linux systems.

If you have any questions or feedback, feel free leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article Pidof Command in Linux
Next Article   BackUp and Restore MySQL/MariaDB Database

Related Posts

  • How to Use sed to Find and Replace String in Files

    How to Use sed to Find and Replace String in Files

    December 18, 2020
  • Linux Head Command

    Linux Head Command

    December 16, 2020
  • Rename Files and Directories in Linux

    How to Rename Files and Directories in Linux

    December 15, 2020

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS 8
    How to Install Python 3.9 on CentOS 8 December 31, 2020
  • How to Install Php 8 on Debian 10
    How to Install PHP 8 on Debian 10 January 2, 2021
  • How to Install Php 8 on Ubuntu 20.04
    How to Install PHP 8 on Ubuntu 20.04 December 28, 2020
  • How to Install GIMP on Debian 10
    How to Install GIMP 2.10 on Debian 10 December 27, 2020
  • How to Install GIMP 2.10 on CentOS 8
    How to Install GIMP 2.10 on CentOS 8 December 30, 2020
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook