Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Modprobe Command in Linux - DesignLinux

Oct 04 2020
designlinux 0 Comments
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.

Related

Tags: terminal

Pidof Command in Linux

Prev Post

BackUp and Restore MySQL/MariaDB Database

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 956
  • 562,977

DesignLinux.com © All rights reserved

Go to mobile version