2.3 Hardware Management, Device Inspection & Kernel Modules
Key Takeaways
lspci -nnkcan display a device’s numeric IDs, active driver and candidate modules. Candidate modules alone do not prove a binding.modprobeuses the module dependency index to load prerequisites.insmodrequests insertion of an individual file.Kernel messages can explain a failed device probe. Module information, hardware inventory and the kernel log answer different questions.
If startup depends on a driver, inspect the initramfs for the specific kernel and use the distribution-supported image generator.
2.3 Hardware Management, Device Inspection & Kernel Modules
Objective 1.2 asks you to distinguish discovery from driver management. A PCI listing can establish that a device is visible before you know whether it has a driver. Module tools tell you what code is available and loaded. Kernel messages can explain why a driver could not attach.
Select the evidence source
| Tool | Evidence it provides |
|---|---|
lspci -nnk | PCI devices, numeric vendor/device IDs, active kernel drivers and candidate kernel modules when available. |
lsusb or lsusb -t | USB device identities or the bus tree with entries such as speed and driver. |
lscpu | CPU architecture, logical CPUs, threads, cores and related topology. Some values describe what a VM can see. |
lsmem | Memory ranges exposed by the Linux memory hotplug interface, including their online or offline state. |
lshw -short | Compact inventory of several hardware classes. Elevated privileges can expose additional detail. |
dmidecode -t memory | Firmware-reported memory records on systems that expose suitable SMBIOS data. Check the OS view separately if you need recognized capacity. |
dmesg | Current kernel ring-buffer messages; access can be restricted. On systemd systems, try journalctl -k -b for recorded kernel messages from the current boot. |
sensors | Readings from supported hardware-monitoring sensors. Part of the lm-sensors tools. |
ipmitool sensor list | Sensor readings from an accessible controller supporting the Intelligent Platform Management Interface (IPMI). |
An embedded Linux device may have a board-specific image and drivers for its peripherals. A device on an integrated bus will not necessarily appear under PCI or USB. Use the board’s documentation and kernel probe messages to determine the bus and driver. A graphics processing unit (GPU) can support display rendering or accelerated compute. Where supported, nvtop reports device utilization and processes using GPU resources. A GPU appearing in lspci establishes enumeration; application access also depends on the driver and runtime.
Loadable modules
A loadable kernel module adds code to the running kernel, for example a filesystem implementation or hardware driver. A driver can also be built into the kernel and will then be absent from lsmod. The kernel applies compatibility and signature policy when a module loads.
| Tool | Action |
|---|---|
lsmod | Lists currently loaded modules and their use counts. |
modinfo MODULE | Reports module metadata such as filename, aliases, parameters and dependencies. |
depmod | Builds the dependency indexes from the installed modules for the selected kernel. |
modprobe MODULE | Resolves a module name or alias and uses the dependency index to load prerequisites. |
insmod /path/to/module.ko | Requests insertion of the supplied file. Prerequisites must already be available to the kernel. |
modprobe -r MODULE | Requests removal and can also remove unused dependencies. |
rmmod MODULE | Requests removal of the named module. An in-use module can be refused. |
An options directive in /etc/modprobe.d/ can set parameters for a module loaded through modprobe. A blacklist directive suppresses the module’s internal aliases for ordinary alias-based discovery. Explicit loads, a load from an earlier boot image, and a driver compiled into the kernel require different investigation. Check whether the running kernel sees the hardware and how the system selected a driver before editing configuration. Removing a driver that supports an active device can disrupt access.
Worked example: PCI device visible but unbound
A newly attached lab network card appears in lspci -nnk, which lists a possible module but has no “Kernel driver in use” entry. The bus detected the card. Check the kernel messages for probe, firmware, or signing errors. Use modinfo MODULE for the candidate driver and modprobe -n -v MODULE to preview what modprobe would do. On an authorized lab system, you can then attempt a load and recheck the kernel messages, PCI driver and host interfaces. An entry under “Kernel modules” is a candidate. “Kernel driver in use” identifies the actual binding.
An early-boot storage driver may need to be in the initial RAM filesystem. On a dracut-based system, inspect an existing image with lsinitrd and regenerate the appropriate image with dracut according to the distribution’s documented procedure. Other releases may use a tool named mkinitrd or another frontend such as Debian’s update-initramfs. Check the target kernel and retain a known-good boot option.
Which command can display both the PCI network card’s currently bound driver and candidate kernel modules?
lscpu
lsusb -t
lspci -nnk
lsmem
A loadable module has prerequisites installed but they are not loaded. Which operation uses the dependency index to insert the prerequisite modules as needed?
modprobe MODULE
lsmod
insmod /path/to/module.ko
modinfo MODULE
What does blacklist testdriver in a modprobe configuration file do by itself?
Unloads the active kernel driver
Removes built-in drivers from the kernel image
Strips the driver from every existing initramfs
Ignores the module’s internal aliases during alias-based loading
Sections you finish are checked off in the contents.