Vultr DocsLatest Content

How to Generate System Hardware Report in Linux

Updated on 04 December, 2025
Generate detailed Linux hardware reports using lshw, inxi, dmidecode, hwinfo, interpret results, and export for audits or troubleshooting.
How to Generate System Hardware Report in Linux header image

Understanding your system's hardware configuration is essential for developers and system administrators. Whether you're verifying hardware compatibility, diagnosing performance issues, or planning upgrades, Linux provides several built-in tools to inspect and report detailed hardware information.

This article demonstrates how to use common Linux utilities to generate system hardware reports, interpret the collected data, and export it in different formats for documentation or troubleshooting purposes.

The Short Answer Version

To quickly view your system's hardware details without generating full reports, use these commands:

# Concise hardware tree
$ sudo lshw -short

# Readable system summary (serials redacted)
$ sudo inxi -Fxz

# BIOS/system info from firmware
$ sudo dmidecode -t system

# Disks/partitions at a glance
$ lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT

# Compact, per-device summary from kernel probes
$ sudo hwinfo --short

Install Common Tools to Generate Hardware Reports

Linux offers several utilities for gathering detailed hardware information. Most distributions include some of them by default, but you can install all of them using your package manager.

On Debian and Ubuntu

Update the package list and install the required tools.

console
$ sudo apt update
$ sudo apt install -y lshw inxi dmidecode hwinfo

On AlmaLinux, Rocky Linux, and RHEL

Follow these steps to enable required repositories and install the tools.

  1. Enable the PowerTools repository.

    console
    $ sudo dnf config-manager --set-enabled powertools
    
    • For RHEL, the repository name differs. Enable the CodeReady Builder repository.

      console
      $ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-$(rpm -E %rhel)-$(arch)-rpms
      
  2. Install the perl-JSON-XS dependency.

    console
    $ sudo dnf install -y perl-JSON-XS
    
  3. Install the hardware reporting tools.

    console
    $ sudo dnf install -y lshw inxi dmidecode hwinfo
    

Tools Overview

  • lshw: Displays detailed information about all hardware components, including CPU, memory, storage, and network devices.
  • inxi: Provides a summarized, human-readable system overview while hiding sensitive identifiers such as serial numbers.
  • dmidecode: Retrieves hardware and BIOS information directly from system firmware (DMI tables).
  • hwinfo: Offers comprehensive device-level data, useful for diagnostics and driver verification.

System Hardware Deep-Dive: Commands & Examples

This section explores commands that help you analyze key hardware components, including CPU, memory, and firmware-level data. Use these tools to verify specifications, identify performance bottlenecks, or confirm hardware allocation in virtualized environments.

CPU

CPU (Central Processing Unit) is the core component responsible for executing instructions.

  • To view CPU architecture, model, core/thread count, and available instruction sets.

    console
    $ lscpu
    

    Output:

    Architecture:             x86_64
      CPU op-mode(s):         32-bit, 64-bit
      Address sizes:          40 bits physical, 48 bits virtual
      Byte Order:             Little Endian
    CPU(s):                   4
      On-line CPU(s) list:    0-3
    Vendor ID:                GenuineIntel
      Model name:             Intel Xeon Processor (Skylake, IBRS)
    ......

    The lscpu utility gathers data from /proc/cpuinfo and system firmware. Key fields include:

    • Architecture: Defines whether the system supports 32-bit, 64-bit, or both instruction sets.
    • CPU(s): Shows total available logical cores.
    • Model name and vendor ID: Useful for identifying virtual CPUs in cloud environments.

Memory (RAM)

The system’s RAM configuration affects overall performance and application responsiveness. You can monitor live usage and inspect physical memory modules using the following commands.

  • View real-time memory usage and swap utilization.

    console
    $ free -h
    

    Output:

                   total        used        free      shared  buff/cache   available
    Mem:           7.7Gi       459Mi       6.2Gi       1.3Mi       1.3Gi       7.3Gi
    Swap:          8.0Gi          0B       8.0Gi

    The free command displays memory statistics in a human-readable format. The "available" field shows the total memory that applications can still use without swapping.

  • Retrieve detailed information about installed DIMMs from system firmware.

    console
    $ sudo dmidecode -t memory
    

    Output:

    # dmidecode 3.5
    Getting SMBIOS data from sysfs.
    SMBIOS 3.0.0 present.
    
    Handle 0x1000, DMI type 16, 23 bytes
    Physical Memory Array
            Use: System Memory
            Maximum Capacity: 8 GB
            Number Of Devices: 1
    
    Handle 0x1100, DMI type 17, 40 bytes
    Memory Device
            Array Handle: 0x1000
            Size: 8 GB
            Type: RAM

    The dmidecode command extracts firmware-level data (DMI tables) that include slot information, maximum capacity, and manufacturer details. This is useful for verifying the physical memory layout or identifying faulty modules.

Disks & Filesystems

Storage devices and mounted filesystems define how data is structured and accessed on a Linux system. Use these commands to list available disks, partitions, and mount points.

  • List all block devices with their size, type, filesystem format, and mount location.

    console
    $ lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
    

    Output:

    NAME     SIZE TYPE FSTYPE MOUNTPOIN
    sr0     1024M rom
    vda      160G disk
    ├─vda1   512M part vfat   /boot/efi
    └─vda2 159.5G part ext4   /

    The lsblk command displays block devices such as disks, partitions, and virtual volumes. Key fields include:

    • TYPE: Identifies whether a device is a physical disk, partition, or virtual block.
    • FSTYPE: Indicates the filesystem type (e.g., ext4, xfs, vfat).
    • MOUNTPOINT: Shows where each partition is mounted in the directory tree.

    You can append -f parameter to the lsblk command to display the filesystem UUIDs and labels.

  • Display mounted filesystems and usage statistics by type.

    console
    $ df -hT
    

    Output:

    Filesystem     Type      Size  Used Avail Use% Mounted on
    efivarfs       efivarfs  256K   19K  233K   8% /sys/firmware/efi/efivars
    /dev/vda2      ext4      328G   16G  298G   6% /
    /dev/vda1      vfat      511M  6.2M  505M   2% /boot/efi

    The df command reports disk space usage for all mounted filesystems.

    Key options:

    • -h: Displays sizes in a human-readable format (e.g., MiB, GiB).
    • -T: Includes the filesystem type in the output.

Network

Network diagnostics are essential for verifying interface configuration, driver compatibility, and IP addressing. Use the following commands to inspect both logical and hardware-level details.

  • List all network interfaces with assigned IP addresses.

    console
    $ ip -br addr
    

    Output:

    lo        UNKNOWN    127.0.0.1/8 ::1/128
    enp1s0    UP         192.2.0.56/23 2001:db8::5400:5ff:feb2:2f70/64

    In the command above:

    • ip: Displays and manipulates network interfaces, routes, and addresses.
    • -br: Enables brief mode, showing compact, colorized output.
    • addr: Lists IP address information for each interface.
  • Display hardware-level details for network interfaces.

    console
    $ sudo lshw -class network
    

    Output:

      *-network                 
           description: Ethernet controller
           product: Virtio 1.0 network device
           vendor: Red Hat, Inc.
           ......
           capabilities: msix pm pciexpress bus_master cap_list fb
           configuration: depth=32 driver=virtio-pci latency=0 mode=1280x800 visual=truecolor xres=1280 yres=800
           resources: iomemory:80-7f irq:22 memory:85200000-85200fff memory:800000000-800003fff
         *-virtio0
              description: Ethernet interface
              ......
              serial: 56:00:05:ba:75:dd
              configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 ip=155.138.194.201 link=yes multicast=yes

    In the command above:

    • lshw: Lists detailed hardware information.
    • -class network: Filters output to only show network-related devices.

Whole-System Summaries

These utilities provide an overview of the entire system's hardware configuration, from CPU and memory to storage, network, and sensors. They're especially useful for audits, documentation, or troubleshooting unfamiliar environments.

  • Readable, redacted system summary.

    console
    $ inxi -Fxz
    

    Output:

    System:
      Kernel: 6.8.0-79-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0
      Console: pty pts/4 Distro: Ubuntu 24.04.3 LTS (Noble Numbat)
    Machine:
      Type: Microsoft System: Vultr product: VHP v: pc-q35-8.2 serial: <superuser required>
      Mobo: N/A model: N/A serial: N/A UEFI: Vultr v: N/A date: N/A
    CPU:
      Info: quad core model: Intel Xeon (Cascadelake) bits: 64 type: MT MCP arch: Cascade Lake rev: 6
        cache: L1: 512 KiB L2: 16 MiB L3: 16 MiB
      Speed (MHz): avg: 2993 min/max: N/A cores: 1: 2993 2: 2993 3: 2993 4: 2993 5: 2993 6: 2993
        7: 2993 8: 2993 bogomips: 47887
    ......

    In the command above:

    • inxi: Generates a comprehensive but human-readable system report.
    • -F: Displays full system information (CPU, memory, disks, network, etc.).
    • -x: Adds extra details like kernel and driver versions.
    • -z: Redacts sensitive information (serial numbers, MACs, etc.) for safe sharing.
  • View hardware tree (complete system details).

    console
    $ sudo lshw
    

    Output:

    demo-server      
        description: Computer
        product: VHP
        vendor: Vultr
        version: pc-q35-8.2
        serial: 89766525
        width: 64 bits
        capabilities: smbios-3.0.0 dmi-3.0.0 smp vsyscall32

    In the command above:

    • sudo: Ensures access to restricted firmware and system data.
    • lshw: Generates a detailed, hierarchical view of all detected hardware.
  • Compact high-level snapshot of hardware components.

    console
    $ sudo hwinfo --short
    

    In the command above:

    • hwinfo: Probes and lists system hardware components.
    • --short: Summarizes output into concise, per-device lines.

Exporting Hardware Reports

In this section, you generate comprehensive hardware reports on your Linux system. The script automates data collection using tools like lshw, inxi, dmidecode, and hwinfo, then stores the output in a timestamped directory. It captures system details such as hostname, kernel version, operating system, CPU information, memory usage, and network configuration. The resulting reports provide a complete overview of your hardware for auditing or troubleshooting purposes.

  1. Create a new shell script file.

    console
    $ nano generate-hw-reports.sh
    
  2. Add the following script into the file. It collects detailed hardware information, organizes the reports, and compresses them into an archive.

    bash
    #!/usr/bin/env bash
    set -euo pipefail
    
    TS=$(date +"%Y-%m-%dT%H-%M-%S")
    HOSTNAME=$(hostname)
    REPORT_DIR="hwreports-${HOSTNAME}-${TS}"
    
    echo "==> Creating report directory: ${REPORT_DIR}"
    mkdir -p "${REPORT_DIR}"
    
    echo "==> Capturing basic system and network information"
    ip route show > "${REPORT_DIR}/routes.txt"
    cat /etc/resolv.conf > "${REPORT_DIR}/dns-config.txt"
    sudo dmidecode -t bios > "${REPORT_DIR}/bios-info.txt"
    uname -a > "${REPORT_DIR}/kernel.txt"
    lsb_release -a > "${REPORT_DIR}/os-release.txt" 2>/dev/null || cat /etc/os-release > "${REPORT_DIR}/os-release.txt"
    sudo dmidecode -t chassis > "${REPORT_DIR}/chassis.txt"
    
    {
    echo "System Hardware Report"
    echo "======================="
    echo "Host: ${HOSTNAME}"
    echo "Generated on: ${TS}"
    echo
    echo "Files included:"
    find "${REPORT_DIR}" -type f | sed 's|^|  - |'
    } > "${REPORT_DIR}/INDEX.txt"
    
    cat <<EOF > "${REPORT_DIR}/metadata.json"
    {
    "hostname": "${HOSTNAME}",
    "timestamp": "${TS}",
    "kernel": "$(uname -r)",
    "os": "$(grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '"')",
    "cpu_count": "$(nproc)",
    "cpu_model": "$(lscpu | awk -F: '/Model name/ {print $2}' | xargs)",
    "total_memory": "$(free -h | awk '/Mem:/ {print $2}')"
    }
    EOF
    
    echo "==> Generating human-readable summary (inxi)"
    inxi -Fxz > "${REPORT_DIR}/system-summary.txt"
    
    echo "==> Generating hardware tree reports (lshw)"
    sudo lshw -sanitize > "${REPORT_DIR}/lshw.txt"
    sudo lshw -sanitize -html > "${REPORT_DIR}/lshw.html"
    sudo lshw -sanitize -json > "${REPORT_DIR}/lshw.json"
    
    echo "==> Dumping firmware/DMI data (dmidecode)"
    sudo dmidecode > "${REPORT_DIR}/dmidecode.txt"
    
    echo "==> Capturing component-specific snapshots"
    lscpu > "${REPORT_DIR}/cpu.txt"
    free -h > "${REPORT_DIR}/memory-usage.txt"
    lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT > "${REPORT_DIR}/disks.txt"
    ip -br addr > "${REPORT_DIR}/net-addr.txt"
    
    echo "==> Generating full hwinfo report (large)"
    sudo hwinfo --all > "${REPORT_DIR}/hwinfo-full.txt"
    sudo hwinfo --short > "${REPORT_DIR}/hwinfo-short.txt"
    
    echo "==> Compressing reports into archive"
    tar -czf "${REPORT_DIR}.tar.gz" "${REPORT_DIR}/"
    
    echo "==> Done! Archive: ${REPORT_DIR}.tar.gz"
    echo "    To extract: tar -xzf ${REPORT_DIR}.tar.gz"
    

    Save and close the file.

  3. Grant execute permissions to the script.

    console
    $ chmod +x generate-hw-reports.sh
    
  4. Run the script to generate the hardware reports.

    console
    $ ./generate-hw-reports.sh
    

    Output:

    ==> Creating report directory: hwreports-K8s-Cluster-Master--01-2025-10-28T18-06-29
    ==> Capturing basic system and network information
    ==> Generating human-readable summary (inxi)

    The script creates a timestamped directory containing all hardware reports, then compresses it into a .tar.gz archive for easy backup or sharing.

    Note
    This script uses -sanitize (for lshw) and -z (for inxi) to remove serial numbers and MAC addresses from the output. Review the generated files before sharing them if your environment treats device IDs or hostnames as sensitive data.

Conclusion

In this article, you generated complete hardware reports using built-in Linux utilities. Tools like lshw, inxi, and dmidecode alongside commands such as lscpu, free, lsblk, and ip help you document CPU, memory, storage, and network information efficiently. Archiving these reports improves audit readiness, troubleshooting, and system documentation.

Comments