Inspect Hardware Information on Linux

Inspect Linux system firmware, CPU, memory, PCI devices, network adapters, storage, sensors, and IPMI hardware.

Linux exposes hardware information through firmware tables, sysfs, procfs, device drivers, and management controllers. No single command reports everything, so this guide groups the most useful tools by component.

Official references:

Install the Utilities

On Ubuntu or Debian, install the common inspection tools:

sudo apt update
sudo apt install -y dmidecode ethtool pciutils usbutils util-linux ipmitool lm-sensors smartmontools nvme-cli lshw

On Fedora, RHEL, or Rocky Linux:

sudo dnf install -y dmidecode ethtool pciutils usbutils util-linux kernel-tools ipmitool lm_sensors smartmontools nvme-cli lshw

Some commands are already included in a minimal installation. Package names and availability can differ between distribution releases.

Record the System Context

Start with the operating system, kernel, architecture, hostname, and virtualization environment:

cat /etc/os-release
uname -a
hostnamectl
systemd-detect-virt

A virtual machine normally reports the hardware and topology presented by its hypervisor. A container usually cannot access host firmware tables, physical storage health, sensors, or the management controller.

Display a concise hardware tree:

sudo lshw -short

Use the sanitized report when the output will be shared. It removes serial numbers, IP addresses, and other potentially sensitive identifiers:

sudo lshw -sanitize

Inspect Firmware and DMI Information

dmidecode reads the System Management BIOS tables supplied by the firmware. It reports what the firmware claims, which can be incomplete or incorrect.

Display the complete table:

sudo dmidecode

Limit the output to one DMI type:

sudo dmidecode --type bios
sudo dmidecode --type system
sudo dmidecode --type baseboard
sudo dmidecode --type chassis
sudo dmidecode --type processor
sudo dmidecode --type cache
sudo dmidecode --type memory

Read individual strings for scripts or inventory records:

sudo dmidecode --string bios-vendor
sudo dmidecode --string bios-version
sudo dmidecode --string system-manufacturer
sudo dmidecode --string system-product-name
sudo dmidecode --string system-serial-number

Extract common BIOS fields:

sudo dmidecode --type bios | grep -Ei 'Vendor:|Version:|Release Date:'

Serial numbers and asset tags can identify a specific machine. Remove them before posting diagnostic output publicly.

Inspect the CPU

Display the CPU architecture, model, sockets, cores, threads, NUMA nodes, caches, and virtualization flags:

lscpu

Display one row per logical CPU:

lscpu --extended=CPU,CORE,SOCKET,NODE,ONLINE,MAXMHZ,MINMHZ

Read the kernel’s detailed per-CPU report:

cat /proc/cpuinfo

When cpupower is installed, inspect the frequency driver, available governors, limits, and current policy:

cpupower frequency-info

The exact package depends on the distribution. Ubuntu commonly supplies cpupower through linux-tools-common and a matching linux-tools package; Debian uses linux-cpupower, while Fedora and RHEL use kernel-tools.

Changing the governor affects performance, power use, temperature, and battery life. Check the available governors before selecting one:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Temporarily request the performance governor when the active driver supports it:

sudo cpupower frequency-set --governor performance

This setting may be reset at boot or overridden by the CPU frequency driver or a power-management service.

Inspect Memory

Display current memory and swap use:

free -h

Display the physical or virtual memory devices described by the firmware:

sudo dmidecode --type memory

Useful fields include Size, Locator, Type, Speed, Configured Memory Speed, Manufacturer, Part Number, and Serial Number. Virtual machines may report only a synthetic memory device.

Inspect PCI and USB Devices

List PCI devices with numeric vendor and device IDs:

lspci -nn

Show the kernel driver assigned to each PCI device and other available modules:

lspci -nnk

Filter the report for wired and wireless network controllers:

lspci -nnk | grep -Ei -A3 'ethernet|network'

Use verbose PCI output only when more detail is needed:

sudo lspci -vv

List USB buses and devices:

lsusb

Display the USB device tree:

lsusb --tree

Inspect Network Adapters

Find the interface names and current link state first:

ip -brief link

Replace eno1 below with the actual wired interface name. Display the negotiated speed, duplex mode, port type, and link status:

sudo ethtool eno1

Display the driver, firmware version, and PCI bus address:

sudo ethtool --driver eno1

Display the permanent hardware address reported by the driver:

sudo ethtool --show-permaddr eno1

Compare it with the address currently assigned to the interface:

ip link show dev eno1

The current address can differ when NetworkManager, systemd-networkd, a virtual machine, or a privacy feature applies MAC-address randomization.

Inspect Storage Devices

Display disks, partitions, filesystems, models, serial numbers, and mount points:

lsblk --output NAME,PATH,MODEL,SERIAL,SIZE,TYPE,FSTYPE,FSAVAIL,FSUSE%,MOUNTPOINTS

Display filesystem UUIDs and labels:

lsblk --fs

Show mounted filesystems backed by real devices:

findmnt --real

Discover devices supported by smartctl:

sudo smartctl --scan-open

Replace /dev/sda with a device returned by the scan, then display its identity, capabilities, health data, error log, and self-test history:

sudo smartctl --all /dev/sda

For NVMe devices, list the controllers and namespaces:

sudo nvme list

Current nvme-cli versions use this command for the SMART and health log:

sudo nvme log smart /dev/nvme0

Older distribution packages may use the compatible legacy spelling:

sudo nvme smart-log /dev/nvme0

A passing SMART status does not replace backups. Watch media errors, critical warnings, available spare, temperature, and rapidly increasing error counts.

Inspect Temperatures, Fans, and Voltages

Display sensors already exposed by loaded kernel drivers:

sensors

On a physical machine, run hardware detection once when expected sensors are missing:

sudo sensors-detect --auto

Review the recommended kernel modules, load them as directed, and run sensors again. Do not expect useful motherboard readings inside most virtual machines or containers. Some laptops expose temperature data through ACPI instead of an lm-sensors-supported monitoring chip.

Inspect an IPMI Management Controller

IPMI is normally available only on servers with a baseboard management controller. Local access requires a compatible Linux OpenIPMI driver and sufficient privileges.

Display controller, chassis, field-replaceable unit, sensor, and event-log information:

sudo ipmitool mc info
sudo ipmitool chassis status
sudo ipmitool fru print
sudo ipmitool sensor list
sudo ipmitool sdr elist
sudo ipmitool sel list

IPMI LAN channel numbers vary by vendor and model. Inspect likely channels before using a number in another command:

sudo ipmitool channel info 1
sudo ipmitool channel info 8

After identifying the LAN channel, display its network settings and user slots. The following examples use channel 1:

sudo ipmitool lan print 1
sudo ipmitool user list 1

For a remote IPMI 2.0 controller, use lanplus and request an interactive password prompt. Replace the example address and username:

ipmitool -I lanplus -H 192.0.2.10 -U administrator -a mc info

Avoid -P password because it places the password in the command line and possibly the shell history or process list.

Optional: Configure the IPMI Network

IPMI network changes are persistent and can disconnect the management controller. Perform them from the server console or another recovery path, confirm the correct channel and user IDs, and record the existing configuration first:

sudo ipmitool lan print 1
sudo ipmitool user list 1

Replace the documentation addresses below with the reserved management address, subnet mask, and gateway for the server. Apply the commands only after checking for an address conflict:

sudo ipmitool lan set 1 ipsrc static
sudo ipmitool lan set 1 ipaddr 192.0.2.10
sudo ipmitool lan set 1 netmask 255.255.255.0
sudo ipmitool lan set 1 defgw ipaddr 192.0.2.1
sudo ipmitool lan set 1 access on
sudo ipmitool lan print 1

To change a known user slot’s password without putting the password in the command line, provide only the verified user ID and respond to the prompts. This example uses user ID 2:

sudo ipmitool user set password 2

Never assume that user ID 2 is the intended administrator. Confirm it with ipmitool user list and verify remote access before ending the console session.

Troubleshooting

DMI Information Is Unavailable

dmidecode requires root privileges and readable firmware tables. Containers, some virtual machines, ARM systems, and systems with restricted firmware access may return incomplete data or no supported entry point.

ethtool Reports Unsupported Operations

Not every driver implements every ethtool query. Confirm the interface and driver, then use the driver’s kernel documentation or vendor utility for unsupported fields:

ip -brief link
sudo ethtool --driver eno1

CPU Frequency Information Is Missing

The guest hypervisor or active CPU driver may not expose cpufreq data. Identify the environment and driver before changing packages or policies:

systemd-detect-virt
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

Sensors Are Missing

Check which hardware-monitoring modules are loaded and whether sysfs contains sensor devices:

lsmod | grep -E 'coretemp|k10temp|nct|it87'
find /sys/class/hwmon -maxdepth 2 -type f -name name -print

Sensor labels and scaling depend on the motherboard and driver. Do not treat an unexplained voltage or temperature reading as authoritative until it is matched with the board documentation.

Local IPMI Access Fails

Check for an IPMI device and load the common local-interface modules when appropriate for the server:

ls -l /dev/ipmi* /dev/ipmi/* 2>/dev/null
sudo modprobe ipmi_devintf
sudo modprobe ipmi_si
sudo ipmitool mc info

If the server uses an OEM-specific transport or does not expose a local IPMI interface, use the vendor documentation or a secured remote lanplus connection.

Save a Diagnostic Snapshot

Create a directory with sanitized, read-only reports before a hardware change or support case:

mkdir -p hardware-report
sudo lshw -sanitize > hardware-report/lshw.txt
lscpu > hardware-report/lscpu.txt
lspci -nnk > hardware-report/lspci.txt
lsusb --tree > hardware-report/lsusb.txt
lsblk --output NAME,PATH,MODEL,SIZE,TYPE,FSTYPE,MOUNTPOINTS > hardware-report/lsblk.txt
sensors > hardware-report/sensors.txt 2>&1

Review every file before sharing it. PCI and USB identifiers are usually harmless, but storage serial numbers, MAC addresses, firmware serial numbers, IPMI addresses, hostnames, and asset tags can identify the system or reveal management-network details.

comments powered by Disqus