N
InsightHorizon Digest

Where are modules stored in Linux

Author

Joseph Russell

Updated on April 11, 2026

Linux. Loadable kernel modules in Linux are loaded (and unloaded) by the modprobe command. They are located in /lib/modules or /usr/lib/modules and have had the extension . ko (“kernel object”) since version 2.6 (previous versions used the .o extension).

How do I find modules in Linux?

  1. “Module” shows the name of each module.
  2. “Size” shows the module size (not how much memory it is using)
  3. “Used by” shows each module’s usage count and the referring modules.

Where are kernel modules stored Linux?

3.3. The /lib/modules/<KERNEL_VERSION>/modules. dep file contains a complete list of kernel module dependencies for the respective kernel version.

Where are module files located?

Modulefiles can be installed in a central location for general use, or in a user directory for personal use. Environment Modules modulefiles are written in the Tcl (Tool Command Language) and are interpreted by the modulecmd program via the module user interface.

WHAT IS modules in Linux?

Linux modules are lumps of code that can be dynamically linked into the kernel at any point after the system has booted. They can be unlinked from the kernel and removed when they are no longer needed. Mostly Linux kernel modules are device drivers, pseudo-device drivers such as network drivers, or file-systems.

How do I unload a Linux module?

To unload a kernel module, we use the rmmod (remove module) command. The following example will unload or remove the speedstep-lib. ko module.

How do I see all the kernel modules installed on Linux?

You need to use lsmod program which show the status of loaded modules in the Linux Kernel. Linux kernel use a term modules for all hardware device drivers. Please note hat lsmod is a trivial program which nicely formats the contents of the /proc/modules , showing what kernel modules are currently loaded.

What are module files?

Modulefiles are files written in the Tool Command Language (Tcl) and are used by the module command to implement different environments for particular applications. Whenever a user on a Unix/Linux based system runs applications, compiles code, etc.

What is module load Linux?

module load [modulefile] Loads module or specifies which dependencies have not been loaded. module unload [modulefile] Unloads specified module from environment.

How do I install a Linux module?
  1. Download and untar or unzip the module you would like to install.
  2. cd into the module directory that contains setup.py and run the install: python setup.py install –prefix=~
Article first time published on

How do I see kernel modules?

How do I find out detailed information about a Linux Kernel module or device drivers? You need to use modinfo command to display or show information about a Linux Kernel loaded modules. Use lsmod command to obtain list of loaded modules. Usually rootkit will install their own ps command, which hides kernel modules.

Where do I put kernel modules?

  1. Edit the /etc/modules file and add the name of the module (without the . ko extension) on its own line. …
  2. Copy the module to a suitable folder in /lib/modules/`uname -r`/kernel/drivers . …
  3. Run depmod . …
  4. At this point, I rebooted and then run lsmod | grep module-name to confirm that the module was loaded at boot.

Where are drivers stored in Linux?

Many Drivers come as part of the distribution’s Kernel. Use Them. These Drivers are stored, as we saw, in the /lib/modules/ directory. Sometimes, the Module file name will imply about the type of Hardware it supports.

How do I install a Linux kernel module?

  1. To load a kernel module, run modprobe module_name as root . …
  2. By default, modprobe attempts to load the module from /lib/modules/kernel_version/kernel/drivers/ . …
  3. Some modules have dependencies, which are other kernel modules that must be loaded before the module in question can be loaded.

How do Linux kernel modules work?

Linux Kernel Modules. Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. … This saves time and prevents the possibility of introducing an error in rebuilding and reinstalling the base kernel.

How do I open a .KO file in Ubuntu?

  1. Download and install Linux insmod. …
  2. Update Linux insmod to the latest version. …
  3. Set the default application to open KO files to Linux insmod. …
  4. Ensure that the KO file is complete and free of errors.

Where can I find kernel module dependencies?

Load a module Instead, use the modprobe command followed by the kernel module name. modprobe attempts to load the module from /lib/modules/<kernel-version>/kernel/drivers/ . This command will automatically check for module dependencies and load those drivers first before loading the specified module.

How do I unload a driver in Linux?

  1. Use the modprobe -r command to unload the hxge driver at any time, without actually uninstalling the driver. host #> lsmod | grep hxge hxge 168784 0 host #> modprobe -r hxge #> lsmod | grep hxge #> …
  2. Uninstall the hxge driver.

What command is used to add or remove kernel modules?

modprobe command is used to add and remove module from the kernel.

How do I read a .KO file in Linux?

KO modules may be loaded by using the insmod Linux program. Installed kernel modules can be listed using the lsmod program, or they may be browsed in the /​proc/​modules directory. As of Linux kernel version 2.6, KO files are used in place of .

What are load modules?

A load module is an executable program stored in a partitioned data set program library. Creating a load module to execute only, will require that you use a batch loader or program management loader. … Once a program is loaded, control is passed to it, with a value in the base register.

CAN module not found?

A module not found error can occur for many different reasons: The module you’re trying to import is not installed in your dependencies. The module you’re trying to import is in a different directory. The module you’re trying to import has a different casing.

How do I install a module file?

  1. Click File > New > Import Module.
  2. In the Source directory box, type or select the directory of the module(s) that you want to import: If you are importing one module, indicate its root directory. …
  3. Type your desired module name(s) in the Module name field(s).
  4. Click Finish.

What is a Unix module?

module is a user interface to the Modules package. The Modules package provides for the dynamic modification of the user’s environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application.

What is the module command?

Basically, the module command modifies your environment so that the path and other variables are set so that you can use a program such as gcc, matlab, or mathematica.

How do I install a Unix module?

Type make install to install modulecmd. tcl, initialization scripts and documentation. Optionally, type make testinstall to run the installation test suite. You can remove the built files from the source code directory by typing make clean .

How do I check if a Linux module is loaded?

Under Linux use the file /proc/modules shows what kernel modules (drivers) are currently loaded into memory.

How do I find my Linux kernel version?

  1. uname -r : Find Linux kernel version.
  2. cat /proc/version : Show Linux kernel version with help of a special file.
  3. hostnamectl | grep Kernel : For systemd based Linux distro you can use hotnamectl to display hostname and running Linux kernel version.

How do I find my Linux driver version?

  1. Select the Main Menu icon and click the option for “Programs.” Select the option for “System” and click the option for “Terminal.” This will open a Terminal Window or Shell Prompt. …
  2. Type “$ lsmod” and then press the “Enter” key.

How do I run a kernel module?

  1. Modify the makefile by replacing every occurrence of helloWorld and kernelRead by the names of the modules you wish to create.
  2. compile the modules by running make in the directory where the modules reside. …
  3. Now become superuser by typing.

How are kernel modules loaded?

There are two ways that a kernel module can be loaded. The first way is to use the insmod command to manually insert the it into the kernel. The second, and much more clever way, is to load the module as it is needed; this is known as demand loading.