Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Modprobe Command in Linux - DesignLinux

designlinux 0 Comments

The Linux kernel is the core component of the Linux operating system. It manages the system’s resources, and it is a bridge between your computer’s hardware and software.

The Linux kernel has a modular design. A kernel module, or often referred to as a driver, is a piece of code that extend the kernel’s functionality. 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 (device manager). However, sometimes you may need to fine-tune how the modules are loaded. For example, you may need to load a module with additional parameters or to prevent the automatic loading of a module.

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.

In this article, we’ll explain how to use modprobe to add and remove modules from the Linux kernel. modprobe is part of kmod, a binary that implements multiple programs used to manage Linux Kernel modules.

Adding Kernel Modules #

The Kernel modules are stored in the /lib/modules/<kernel_version> directory. You find the version of the running kernel, use the uname -r command.

Only users with administrative privileged can manage Kernel modules.

To load a module, invoke the modprobe command followed by the module name:

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.

Use the lsmod command to confirm that the module is loaded:

lsmod | grep module_name

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

modprobe module_name parameter=value

The command accepts multiple parameter=value pairs separated by space.

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:

/etc/modules-load.d/module_name.conf
option module_name parameter=value

The settings specified in these files are read by udev, which loads the modules at system startup using modprobe.

Removing Kernel Modules #

To remove a module, invoke the modprobe command with the -r option followed by the module name:

modprobe -r module_name

modprobe will also remove the unused module dependencies.

When invoked with -r, the command accepts multiple modules as arguments:

modprobe -r module_name1 module_name2

If you want 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:

/etc/modprobe.d/blacklist.conf
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 allows you to add and remove Linux kernel modules.

Feel free to leave a comment if you have any questions.

modprobe kernel terminal

Related

Tags: kernel, modprobe, terminal

How to Install Apache with Virtual Host on CentOS 8

Prev Post

Linux Mint 20 Beta is Now Available to Download

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
  • 624
  • 609,983

DesignLinux.com © All rights reserved

Go to mobile version