1. Overview

On a Linux system, the dmidecode command retrieves the system hardware information. In detail, this command reads the hardware data stored in the Desktop Management Interface (DMI) table on the system. The Distributed Management Task Force (DMTF) created the Desktop Management Interface as a standard to manage and track hardware components.

In this tutorial, we’ll understand how to use dmidecode to display hardware information like BIOS, processor, memory, and other component data.

2. Installation and Basic Usage

To begin with, if the dmidecode command is not installed on a system, we should be able to easily install it using the respective native package manager.

For example, in Debian-based systems we can use apt:

$ sudo apt install dmidecode

Alternatively, we use yum to install this tool in RedHat-based systems:

$ sudo yum install dmidecode

In general, the dmidecode command utilizes a straightforward syntax:

sudo dmidecode [options]

We need to run dmidecode with the sudo command to ensure we have the necessary permissions to read sensitive information from the DMI tables. For instance, running dmidecode without sudo may result in permission errors:

$ dmidecode
# dmidecode 3.3
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
Scanning /dev/mem for entry point.
/dev/mem: Permission denied

Meanwhile, using sudo ensures we get the necessary permissions:

$ sudo dmidecode
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
62 structures occupying 3493 bytes.
Table at 0x000E6D50.

...

Running dmidecode without any options displays an extensive output containing all the DMI information available. However, we can run dmidecode with various options to filter this information.

3. Filter by Type Using the -t Option

The -t option lets administrators specify the information type to display.

3.1. BIOS Information

For instance, let’s start by showing information about the BIOS:

$ sudo dmidecode -t bios
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x000B, DMI type 0, 24 bytes
BIOS Information
    Vendor: Insyde
    Version: F.31
    Release Date: 10/23/2014
...

Above, we output detailed information about the BIOS:

  • Vendor: manufacturer of the BIOS
  • Version: BIOS version number
  • Release Date: date when the BIOS was released

This information includes other fields as well.

3.2. System Information

Next, let’s display detailed information about the system:

$ sudo dmidecode -t system
...
Handle 0x000C, DMI type 1, 27 bytes
System Information
    Manufacturer: Hewlett-Packard
    Product Name: HP 15 Notebook PC
    Version: 0990110000000000000600087
    Serial Number: CND4471N5Y
...

Let’s break down some of these fields:

  • Manufacturer: system manufacturer
  • Product Name: product name
  • Serial Number: system serial number

These fields can help identify a system or its components.

3.3. Processor Information

Further, we can show the -t processor option to show the processor information:

$ sudo dmidecode -t processor
...
Handle 0x0037, DMI type 4, 42 bytes
Processor Information
    Socket Designation: U3E1
    Type: Central Processor
    Family: Core i3
    Manufacturer: Intel(R) Corporation
...

Again, let’s understand some of the fields:

  • Socket Designation: socket where the CPU is installed
  • Type: type of processor
  • Family: processor family
  • Manufacturer: CPU manufacturer
  • Max Speed: maximum speed of the processor in MHz
  • Core Count: number of cores

Additionally, we can display the CPU cache information:

$ sudo dmidecode -t cache
...
Handle 0x0038, DMI type 7, 19 bytes
Cache Information
    Socket Designation: L1 Cache
    Configuration: Enabled, Not Socketed, Level 1
...

So, this command shows the information about the different levels of cache (L1, L2, L3) along with their characteristics.

3.4. Main Memory Information

To retrieve information about the system memory, we use -t memory:

$ sudo dmidecode -t memory
...
Handle 0x0001, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
...

This command displays the details about each memory device:

  • Manufacturer: manufacturer of the memory module
  • Type: type of memory
  • Size: size of the memory module
  • Speed: speed of the memory module in MHz

Information about the main memory can aid with debugging, troubleshooting, and testing.

3.5. Motherboard Information

We can use -t baseboard to retrieve the baseboard (motherboard) information:

$ sudo dmidecode -t baseboard
...
Handle 0x000D, DMI type 2, 16 bytes
Base Board Information
    Manufacturer: Hewlett-Packard
...

Let’s discuss some of this output:

  • Features: characteristics of the baseboard such as whether it’s replaceable or a hosting board
  • Location in Chassis: location of the baseboard within the chassis

Thus, we get comprehensive information about the system baseboard.

4. Searching Using the -s Option

The -s option enables us to use a keyword to extract specific information from the DMI table. In particular, it’s crucial when we want to access specific information like the BIOS version without going through the extensive output of the dmidecode command.

To demonstrate, let’s extract the vendor of the BIOS:

$ sudo dmidecode -s bios-vendor
Insyde

This command uses the bios-vendor keyword and displays the vendor as Insyde.

After that, let’s extract information about the version of BIOS:

$ sudo dmidecode -s bios-version
F.31

In this example, we use the bios-version keyword to display the version of BIOS, in this case, F.31.

Next, let’s find out the release date of the BIOS:

$ sudo dmidecode -s bios-release-date
10/23/2014

Here, the release date is 10/23/2014 as indicated by the bios-release-date keyword.

Further, we can extract the Product Name from the system information:

$ sudo dmidecode -s system-product-name
HP 15 Notebook PC

The system-product-name keyword gives the output as HP 15 Notebook PC.

Also, we get the system manufacturer:

$ sudo dmidecode -s system-manufacturer
Hewlett-Packard

We use the system-manufacturer keyword to display the manufacturer, in this case, Hewlett-Packard.

Finally, to view the system’s Serial Number information, we utilize the system-serial-number keyword:

$ sudo dmidecode -s system-serial-number
CND4471N5Y

This command outputs the Serial Number as CND4471N5Y.

This way, we can use specific words instead of component categories.

5. Advanced Filtering With grep

Of course, we can also extract specific information from the detailed output of dmidecode by combining it with the grep command:

$ sudo dmidecode | grep <pattern>

In this syntax, represents the text string or regular expression to match against in the output of the dmidecode command.

To illustrate, we search for a specific version number within the BIOS information:

$ sudo dmidecode -t bios | grep -i F.31
    Version: F.31

So, the command above filters the BIOS information section and shows the lines that contain the version number F.31. In this case, -i ensures that the search is case-insensitive.

Furthermore, let’s find a specific manufacturer from within the system information section:

$ sudo dmidecode -t system | grep -i Hewlett-Packard
    Manufacturer: Hewlett-Packard

This command filters the system information section and displays the lines that contain the manufacturer Hewlett-Packard.

6. Conclusion

In this article, we explored the dmidecode command and how to use it to retrieve detailed information about the system’s hardware components.

In conclusion, by understanding how to interpret the output of dmidecode and customize it via the command options, we can gain valuable knowledge about the system hardware. Thus, the approaches we discussed help us understand and effectively manage the current hardware setup.