Pcornel
Linux · Kernel & Hardware

Kernel Modules

Cheat sheet · https://pcornel.dk/topic.php?topic=2840

Back to the Topic

Answer

Kernel modules are loadable pieces of the kernel (drivers, filesystems, netfilter features) in /lib/modules/$(uname -r). modprobe loads them with dependencies; /etc/modules-load.d and /etc/modprobe.d configure loading and options.

Remember

Use modprobe, not insmod. Persist loading in /etc/modules-load.d/<name>.conf and options in /etc/modprobe.d/. Blacklist with blacklist <module> and rebuild the initramfs if the module loads early. Secure Boot rejects unsigned third-party modules.

First checks

  • modinfo <module> — module details
  • uname -r — running kernel
  • lsmod — loaded modules
  • lspci -k — PCI devices and the driver in use
  • lsusb — USB devices
  • journalctl -k -b -p warning — kernel warnings this boot

Verify in this order

module present for the running kernel → modprobe resolves dependencies → loaded with options → feature available

Where it usually breaks

First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2840

Confirmation

Confirm action

Continue?