Obtain Linux kernel module information with modinfo

Every time the Linux system is booted, number of kernel modules are loaded by the system and used to provide additional support for filesystem, new hardware etc. Obtaining an information about particular kernel module may a be an important troubleshooting skill. In this article we will explain how to obtain module information such as description, dependency, author or relevant object file name using modinfo command.

Any loadable kernel module is by default installed within /lib/modules directory. For an each particular kernel a separate directory as created to contain modules to be used with that particular kernel:

# ls /lib/modules/
3.14.5-200.fc20.x86_64  3.14.6-200.fc20.x86_64  3.14.8-200.fc20.x86_64

From the above example we can see that this particular system has three kernels installed. Only one kernel can be run at any given time:

# uname -a
Linux localhost.localdomain 3.14.8-200.fc20.x86_64 #1 SMP Mon Jun 16 21:57:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

The above uname command output shows that 3.14.8-200.fc20 is a current system’s running kernel and thus modules loaded from /lib/modules/3.14.8-200.fc20.x86_64/ directory are in use. To list all currently loaded kernel modules we can use lsmod command:

$ lsmod
e1000e                258512  0 
ghash_clmulni_intel    13216  0 
i2c_algo_bit           13257  1 i915
drm_kms_helper         50652  1 i915
drm                   283747  4 i915,drm_kms_helper
ptp                    18725  1 e1000e
pps_core               19130  1 ptp

From here we can dig mode information about any particular module using modinfo command. First, we can get the general module description:

$ modinfo -d e1000e
Intel(R) PRO/1000 Network Driver

What is the actual object file location for this particular module:

$ modinfo -n e1000e

To see an object file location for any given installed Linux kernel -k switch can be used.

$ modinfo -k 3.14.5-200.fc20.x86_64 -n e1000e

Information about the author:

$ modinfo -a e1000e
Intel Corporation, 

or to find module’s dependency information we can use -F switch:

$ modinfo -F depends e1000e 

Executing modinfo with no parameters will cause modinfo command to print all available information.