dmidecode Command in Linux



The Linux dmidecode command prints the DMI table contents in a human-readable format. The DMI table, also known as the Desktop Management Interface table, tracks the system hardware components such as processor, memory, and I/O ports. It is a part of the system management BIOS (SMBIOS).

Table of Contents

Here is a comprehensive guide to the options available with the dmidecode command −

Syntax of dmidecode Command

The general syntax for using the dmidecode command is as follows −

dmidecode [options]

The [options] field is used to manage the output behavior of the command.

dmidecode Command Options

The options used with the dmidecode command are listed in the table below −

Flag Option Description
-d file --dev-mem file It reads memory from the device file; the default is /dev/mem
-q --quiet It displays output in a less verbose form
-s keyword --string keyword It displays the value of specified DMI keywords, such as bios-release-date, system-manufacturer, and chassis version (If an invalid keyword is given then a list of valid keywords will appear)
-t type --type type It only displays the entries of the specified type such as bios, system, processor, memory
-u --dump It dumps the contents in the hexadecimal format which helps in debugging
--dump-bin file It dumps the entries to a file in binary format
--from-dump file It reads the DMI data dumped in a binary file
-h --help It displays the usage help about command
-V --version It displays the command version

Understanding the dmidecode Command Output

The dmidecode command output has different components. Let’s take an example of the following output.

In the output given below, the system boot information is retrieved. The system boot type ID is 32 (all type IDs are given in the table below).

Understanding dmidecode Command Output

Each entry has two sections, a DMI Header and a DMI Data.

DMI Header − It has three values −

  • Handle − It is a unique identifier for the table entry (0x2000)
  • Type − It indicates the hardware component type by an ID (32 system boot)
  • Size − It shows the size of the record (11 bytes)

DMI Data − It contains details about the entry record such as Hardware Manufacturer, Vendor, Part Number, and other relevant information.

Examples of dmidecode Command in Linux

This section demonstrates the usage of the dmidecode command in Linux through various examples −

  • Displaying all DMI Table Entries
  • Displaying DMI Table Entry by a Keyword
  • Displaying DMI Table Entry by a Type
  • Displaying the DMI Table Entries in Hexadecimal Format
  • Dumping the DMI Table Entries to a File in Binary Format

Displaying all DMI Table Entries

To display all the entries of the DMI table, execute the dmidecode command with sudo privileges −

sudo dmidecode
Displaying all DMI Table Entries 1

To get output in scrollable format, pipe the output to the less command −

sudo dmidecode | less

Press q to exit the scrollable output.

To display less verbose output, use the following option −

sudo dmidecode -q
Displaying all DMI Table Entries 2

Displaying DMI Table Entry by a Keyword

To print the DMI value of a specific keyword, the -s, or --string option is used with the keyword. All the keywords are listed in the following table −

S. No. Keywords
1 bios-vendor
2 bios-version
3 bios-release-date
4 bios-revision
5 firmware-revision
6 system-manufacturer
7 system-product-name
8 system-version
9 system-serial-number
10 system-uuid
11 system-sku-number
12 system-family
13 baseboard-manufacturer
14 baseboard-product-name
15 baseboard-version
16 baseboard-serial-number
17 baseboard-asset-tag
18 chassis-manufacturer
19 chassis-type
20 chassis-version
21 chassis-serial-number
22 chassis-asset-tag
23 processor-family
24 processor-manufacturer
25 processor-version
26 processor-frequency

To print the processor frequency, use the following option −

sudo dmidecode -s processor-frequency
Displaying DMI Table Entry by a Keyword 1

To print system UUID, use the following option −

sudo dmidecode -s system-uuid
Displaying DMI Table Entry by a Keyword 2

To print the BIOS release date, use the following option −

sudo dmidecode -s bios-release-date
Displaying DMI Table Entry by a Keyword 3

In the same way, any value can be printed.

Displaying DMI Table Entry by a Type

The DMI table displays the output by the type ID or simply mentioning the type keyword with the -t or --type option. A list of all type IDs is given in the following table −

Type Description
0 BIOS
1 System Board
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Association
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device

A list of type keywords is given in the table below −

Keywords Equivalent Type IDs
bios 0
system 1, 12, 15, 23, 32
baseboard 2, 10, 41
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9

To display the entries of type bios, use −

sudo dmidecode -t bios
Displaying DMI Table Entry by Type 1

To display entries of multiple types, mention the type IDs separated by a comma −

sudo dmidecode -t 16,32
Displaying DMI Table Entry by Type 2

Displaying the DMI Table Entries in Hexadecimal Format

To display DMI table entries in hexadecimal format, the -u or --dump option is used. This option is mainly used for debugging purposes −

sudo dmidecode -u
Displaying DMI Table Entries in Hexadecimal Format

Dumping the DMI Table Entries to a File in Binary Format

The --dump-bin option uses the file name to store the DMI output in binary format to a file.

sudo dmidecode --dump-bin output.bin
Dumping DMI Table Entries to File in Binary Format 1

The binary output is useful to process the data by a script or software.

To read the binary file, use --from-dump with the filename −

sudo dmidecode --from-dump output.bin
Dumping DMI Table Entries to File in Binary Format 2

Conclusion

The Linux dmidecode command is a useful command-line utility for displaying system hardware-related information in a human-readable format. This information can also be saved in both hexadecimal or binary formats. These formats are useful for debugging the system or parsing hardware data with a script or software for further processing.

This tutorial covered the dmidecode command in detail, such as its syntax, options, and usage in Linux with examples.

Advertisements