Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of Linux Kernel Module

Is there any utiliy, that shows where the location of the module I have loaded.

like image 841
user567879 Avatar asked Jan 11 '11 06:01

user567879


People also ask

Where are modules installed in Linux?

Modules can usually be installed with the package manager of your Unix system. It it is available by default on most Linux distributions, on OS X and FreeBSD either under the name of modules or environment-modules .

How do I find modules in Linux?

The easiest way to list modules is with the lsmod command. While this command provides a lot of detail, this is the most user-friendly output. In the output above: "Module" shows the name of each module.

How do I list loaded kernel modules?

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


1 Answers

If you want to know the base memory address for a module in the kernel's virtual address space, it can be found as the last field in /proc/modules; search for the module in question:

$ grep '^ext3' /proc/modules
ext3 125513 1 - Live 0xf88ce000

If you want to know the file path it was loaded from, the original path is not actually stored anywhere, but you can ask modprobe to search for the module again and display the path using modprobe -l:

$ /sbin/modprobe -l ext3
/lib/modules/2.6.18-194.el5PAE/kernel/fs/ext3/ext3.ko

Assuming you haven't changed anything in the module search path in the intervening time, this should give you the original load path.

EDIT: As of 2015, the information isn't correct (not only that ext4 doesn't exist as a kernel module). Get information about the module, including the path of the image with:

modinfo floppy

like image 91
bdonlan Avatar answered Sep 19 '22 18:09

bdonlan