Loading...

Lab 107: Hardware Inventory Basics

Inventory PCI, USB, and block devices using standard CLI tooling, then map a target PCI device to its bound kernel driver. Confirm the driver module state using module inspection paths.

inventory hardware troubleshooting

Scenario

You need a quick, reliable hardware inventory baseline for a Linux host. Enumerate PCI and USB devices, inspect block devices and mount points, then pick a PCI device and prove which kernel driver is bound to it and whether that driver module is loaded.

Operator context

Establish this baseline before deeper debugging. You cannot troubleshoot drivers, storage, or connectivity if you do not first confirm what the kernel can actually see.

Objective

  • Enumerate PCI devices including numeric vendor and device IDs.
  • Map a PCI device to its bound kernel driver and candidate modules.
  • Enumerate attached USB devices.
  • Inspect block devices and mount points.
  • Confirm the target driver module state.

Concepts

  • Stable PCI identification using vendor:device IDs from lspci -nn .
  • Driver binding evidence: “kernel driver in use” versus “kernel modules” from lspci -k output.
  • Peripheral inventory using lsusb for USB buses and devices.
  • Block device and mount visibility with lsblk before you touch storage.
  • Module load validation with lsmod and kernel-provided module state ( /proc/modules ).

Walkthrough

Step 1 : List PCI devices including vendor:device numeric IDs.
Command
lspci -nn

Numeric IDs provide stable identification across vendors and distributions. Use them when correlating devices with driver support matrices or kernel module names.

00:03.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet [8086:100e]
Step 2 : Map a PCI device to the bound kernel driver.
Command
lspci -nnk

This reveals the binding state. Kernel driver in use is the runtime driver. Kernel modules lists candidate modules that could handle the device.

Kernel driver in use: e1000
Kernel modules: e1000
Target selection

Pick one PCI device line from your output and use that driver/module name in Step 5. The example uses e1000 as the module name.

Step 3 : Inventory attached USB devices.
Command
lsusb

USB inventory helps validate keyboards, storage adapters, wireless receivers, and other peripherals that may not show up in PCI output.

Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Step 4 : Inspect block devices and mount points.
Command
lsblk -o NAME,MAJ:MIN,RM,SIZE,RO,TYPE,MOUNTPOINTS

lsblk provides a clean view of disks, partitions, and mount points. Confirm what is mounted and where before you touch storage.

sda
├─sda1 /boot
└─sda2 /
Step 5 : Confirm the target driver module state.
Command
lsmod | grep -E '^e1000(\s|$)'

This confirms the module is loaded in the running kernel. If the module is not present, it may be built-in, blacklisted, missing, or not bound to the device.

e1000               155648  0
Alternate
grep e1000 /proc/modules

/proc/modules is a direct view of loaded modules (name, size, use count). It can be useful in minimal environments and scripting contexts.

Common breakpoints

lspci output is empty or missing expected devices

If devices are missing, validate BIOS/UEFI settings, passthrough mappings (virtualization), and that the host is seeing the bus at all. Hardware and platform configuration issues must be resolved before driver debugging.

Kernel driver in use is blank

The device is present but unbound. Confirm candidate modules from Kernel modules output, then check kernel logs for probe or binding errors.

Module not shown in lsmod

Some drivers are built into the kernel and will not appear in lsmod . Cross-check with /proc/modules and confirm binding again with lspci -k for the target device.

Device present but block/mount output looks wrong

If storage is missing or mount points are unexpected, validate with multiple views. Confirm device nodes exist under /dev and check recent kernel messages for hotplug or bus resets.

Cleanup checklist

This lab is read-only. Your cleanup is capturing output for documentation or escalation and leaving the host unchanged.

Commands
lspci -nn
lspci -nnk
lsusb
lsblk -o NAME,MAJ:MIN,RM,SIZE,RO,TYPE,MOUNTPOINTS
lsmod | head
Success signal

You can name the target device by vendor:device ID, identify the bound kernel driver, and show module state without guessing.

Reference

  • lspci -nn : Lists PCI devices and includes numeric vendor and device IDs.
    • -n : Displays numeric IDs (often used twice as -nn to show both text and numeric IDs).
  • lspci -nnk : Shows kernel driver binding and candidate modules.
    • -k : Displays the kernel driver currently bound to each device.
  • lsusb : Lists USB buses and attached devices.
  • lsblk -o <cols> : Lists block devices with selected columns.
    • MOUNTPOINTS : Shows all mount points associated with a device.
  • lsmod : Lists currently loaded kernel modules.
  • /proc/modules : Kernel-exported view of loaded modules (name, size, use count).
  • grep <pattern> <file> : Filters lines that match a pattern.
    • <pattern> : The string or regex you are matching (for example e1000 ).
    • <file> : The file to search (for example /proc/modules ).