Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Rmmod Command in Linux - DesignLinux

designlinux 0 Comments

The core component of each Linux operating system is the Linux kernel. It manages the system’s resources, and acts as an intermediary between the computer’s hardware and software.

The Linux kernel is a software that has a modular design. A kernel module, or often referred to as a driver, is a piece of code that extends the kernel’s functionality. Modules can be compiled as loadable modules or built into the kernel. Loadable modules can be dynamically loaded and unloaded in the running kernel on request, without the need to reboot the system.

In this article, we’ll talk about how to use the rmmod command to remove modules from the Linux Kernel.

rmmod Command #

The general syntax for the rmmod (remove module) command is as follows:

rmmod [OPTIONS] MODULE_NAME...

On modern Linux systems, rmmod is part of kmod, a binary that implements multiple programs used to manage Linux kernel modules.

Only users with administrative privileged can remove modules.

You can print a list of all modules loaded on your system with the lsmod command. The Kernel modules are stored in the /lib/modules/<kernel_version> directory.

Removing a module with the rmmod command is pretty simple; simply invoke the command followed by the module name:

rmmod module_name

The command prints message only if something goes wrong. For example, if another module uses the module, the command will print something like this:

rmmod: ERROR: Module module_name is in use by: module_name_2

To display information about what the command is doing, use the -v (--verbose) option.

If you want to remove a module that is being used or not designed to be removed, invoke the command with the -f (--verbose) option. Using this option is extremely dangerous as it can cause a system crash.

rmmod also accepts multiple modules as arguments:

rmmod module_name1 module_name2

Prevent a Kernel Module from Loading at Boot-Time #

When a module is removed using the rmmod command, the module remains unloaded until the system is rebooted. On the next system boot, the removed module will be loaded.

To permanently disable 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 rmmod command is used to remove Linux kernel modules. Generally, most Linux users are using the modprobe -r command instead of rmmod.

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

rmmod kernel terminal

Related

Tags: kernel, rmmod, terminal

How to Install Hadoop Single Node Cluster (Pseudonode) on CentOS 7

Prev Post

Bash break and continue

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
  • 589
  • 1,055,361

DesignLinux.com © All rights reserved

Go to mobile version