• 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 December 10, 2022
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 Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install PHP 8.2 on Debian 11
    How to Install PHP 8.2 on Debian 11 Linux February 24, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
© 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