Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

modinfo

Show information about a kernel module: file, description, license, dependencies, aliases and parameters.

Level
RHCSA exam
Group
Kernel and hardware
Needs root
No
Package
kmod

What it does

modinfo NAME reads the module file (also when it is not loaded). The parm: lines list the parameters you can set with modprobe or in /etc/modprobe.d/. The alias: lines show which hardware IDs the module supports.

How to write it

modinfo [OPTION]... MODULE|FILE...

Options 11

Most used

-p, --parameters
Only the parameters.
-F, --field FIELD
Only one field: filename, description, author, license, depends, alias, parm, version, vermagic …
-d, --description
Only the description.
-a, --author
Only the author.
-l, --license
Only the license.
-n, --filename
Only the file name.
-k KERNEL
Use the modules of another kernel version.
-b, --basedir DIR
Use another root for /lib/modules.
-0, --null
Separate fields with NUL.
-V, --version
Show the version.
-h, --help
Show help.

Examples 10

$ run as a normal user# run as root (or with sudo)

  1. 1All information

    modinfo xfs
    filename:       /lib/modules/6.12.0-55.9.1.el10_0.x86_64/kernel/fs/xfs/xfs.ko.xz
    description:    SGI XFS with ACLs, security attributes, realtime, quota, no debug enabled
    license:        GPL

    Plus depends, signature and more.

  2. 2Parameters of a module

    modinfo -p loop
    max_loop:Maximum number of loop devices (int)
    max_part:Maximum number of partitions per loop device (int)

    Set them with options loop max_part=8.

  3. 3Only the file

    modinfo -n vfat

    Where the .ko file is.

  4. 4Dependencies

    modinfo -F depends vfat
    fat

    modprobe loads these first.

  5. 5Hardware IDs a driver supports

    modinfo -F alias e1000e | head

    Match with lspci -nn IDs.

  6. 6Is the module signed? (Secure Boot)

    modinfo -F signer xfs

    Red Hat signs its modules; unsigned ones do not load with Secure Boot.

  7. 7Current value of a parameter

    cat /sys/module/loop/parameters/max_part

    modinfo shows the options; /sys shows the active value.

  8. 8Modules of another kernel

    modinfo -k 6.12.0-55.el10.x86_64 xfs | head -2

    Check before you boot an older kernel.

  9. 9Description only

    modinfo -d usb-storage

    Short text.

  10. 10License (tainted kernel check)

    modinfo -l nvidia 2>/dev/null

    Non-GPL modules taint the kernel; support may ask.

Exit codes

0 :: Done. 1 :: Module not found or error.