Scenario
A USB device is not working and may be missing a kernel module. You have been asked to investigate, load the correct module, verify it is active, and configure it to load on every boot.
This is how you validate driver availability and turn a one-time fix into a persistent configuration change.
Objective
- List currently loaded kernel modules.
- Inspect metadata for a suspected module.
- Load a module immediately using
modprobe. - Verify the module is loaded after insertion.
- Locate the kernel modules directory for this kernel.
- Configure the module to auto-load on boot.
Concepts
-
lsmodanswers “what is loaded right now,” not “what exists on disk.” A module can be present under/lib/modulesand still not be loaded. -
modprobeis preferred overinsmodbecause it resolves dependencies automatically. -
modinfois your reality check: file path, description, and aliases help confirm you are loading the right driver. -
/etc/modules-load.dis for explicit boot-time module loads. Use it when auto-detection is unreliable or intentionally disabled.
Walkthrough
lsmod
lsmod shows what modules are currently loaded. This helps confirm whether
the suspected driver is already present before you load anything.
Module Size Used by
xhci_pci 20480 0
usbcore 294912 3 xhci_pci,ehci_hcd,usb_common
usb_storage.
modinfo usb_storage
modinfo confirms what the module is, where its .ko file lives,
and which device classes it matches. This prevents guesswork.
filename: /lib/modules/5.15.0-88-generic/kernel/drivers/usb/storage/usb-storage.ko
description: USB Mass Storage driver for Linux
license: GPL
alias: usb:v*p*d*dc*dsc*dp*ic08isc06ip50in*
sudo modprobe usb_storage
modprobe loads the module and resolves dependencies automatically.
Inserting modules is a privileged kernel operation, so sudo is typical.
lsmod | grep usb_storage
This confirms the module is now present in the loaded module list.
usb_storage 69632 0
ls /lib/modules/5.15.0-88-generic/
This directory contains all modules for a specific kernel. It is useful for confirming whether a module exists on disk even if it is not currently loaded.
kernel/ modules.alias modules.dep modules.softdep updates/
echo usb_storage | sudo tee /etc/modules-load.d/usb.conf
Adding the module name to a file under /etc/modules-load.d configures systemd
to load it during boot. This turns your fix into persistent behavior.
usb_storage
Common breakpoints
The module is not installed for this kernel. Confirm the running kernel with
uname -r, then check /lib/modules/$(uname -r). If the
directory is missing modules, you may need the correct kernel modules package.
Check the kernel log for the actual failure reason:
dmesg | tail -n 50. Missing dependencies, secure boot policy, or a
mismatched kernel/modules set are common causes.
The driver is only one layer. Validate device detection and errors with:
dmesg | tail, and confirm the block device appears with lsblk.
Confirm your file exists and contains only the module name:
cat /etc/modules-load.d/usb.conf. Also check for a blacklist entry that blocks it:
grep -R usb_storage /etc/modprobe.d.
Cleanup checklist
If you do not want this module to auto-load, remove the file:
sudo rm -f /etc/modules-load.d/usb.conf and confirm it is gone:
ls /etc/modules-load.d.
usb_storage appears in lsmod after loading, and your boot-time
config file contains the expected module name.
Reference
lsmod: Lists modules currently loaded in the kernel.modinfo <module>: Displays module metadata.modprobe <module>: Loads a module and resolves dependencies automatically./lib/modules/<kernel-version>: Installed module tree for that kernel./etc/modules-load.d/*.conf: Modules that should be loaded during boot.tee: Writes stdin to a file (useful withsudo).