Linux dmidecode Command with Practical Examples

LinuxLinuxBeginner
Practice Now

Introduction

In this lab, we will introduce the dmidecode command, a powerful tool for retrieving detailed hardware information on Linux systems. The dmidecode command can display a wide range of hardware details, including system manufacturer, model name, serial number, BIOS version, processor information, and memory configuration. We will start by installing the dmidecode package and then use the command to explore the system's hardware specifications. Additionally, we will demonstrate how to extract specific hardware details, such as processor information, using dmidecode.

Linux Commands Cheat Sheet


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/BasicFileOperationsGroup(["`Basic File Operations`"]) linux(("`Linux`")) -.-> linux/PackagesandSoftwaresGroup(["`Packages and Softwares`"]) linux(("`Linux`")) -.-> linux/UserandGroupManagementGroup(["`User and Group Management`"]) linux/BasicFileOperationsGroup -.-> linux/cat("`File Concatenating`") linux/PackagesandSoftwaresGroup -.-> linux/apt("`Package Handling`") linux/UserandGroupManagementGroup -.-> linux/sudo("`Privilege Granting`") subgraph Lab Skills linux/cat -.-> lab-422645{{"`Linux dmidecode Command with Practical Examples`"}} linux/apt -.-> lab-422645{{"`Linux dmidecode Command with Practical Examples`"}} linux/sudo -.-> lab-422645{{"`Linux dmidecode Command with Practical Examples`"}} end

Introduction to dmidecode Command

In this step, we will introduce the dmidecode command, a powerful tool for retrieving detailed hardware information on Linux systems.

The dmidecode command is a free software that reads information about a system's hardware from the BIOS according to the SMBIOS/DMI standard. It can display a wide range of hardware information, including system manufacturer, model name, serial number, BIOS version, processor details, memory configuration, and more.

Let's start by installing the dmidecode package:

sudo apt-get update
sudo apt-get install -y dmidecode

Now, we can use the dmidecode command to display the system's hardware information:

sudo dmidecode

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: VMware, Inc.
        Product Name: VMware Virtual Platform
        Version: None
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        UUID: 421d93c1-d12f-2a19-5a1c-4f3b6a4f9a6d
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Virtual Machine

The output provides a wealth of information about the system's hardware, including the manufacturer, product name, serial number, UUID, and more.

We can also extract specific hardware details using the dmidecode command. For example, to get the processor information, we can use the following command:

sudo dmidecode -t processor

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0003, DMI type 3, 21 bytes
Chassis Information
        Manufacturer: VMware, Inc.
        Type: Virtual Machine
        Lock: Not Present
        Version: None
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        Asset Tag: Not Specified
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None

This command displays detailed information about the system's processor, including the manufacturer, model, speed, and other relevant details.

The dmidecode command provides a wealth of hardware information and can be a valuable tool for system administrators and IT professionals. In the next steps, we'll explore more practical examples of using dmidecode to retrieve specific hardware details.

Displaying System Hardware Information

In this step, we will use the dmidecode command to display detailed information about the hardware components of the system.

First, let's use the dmidecode command to display the overall system information:

sudo dmidecode -t system

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: VMware, Inc.
        Product Name: VMware Virtual Platform
        Version: None
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        UUID: 421d93c1-d12f-2a19-5a1c-4f3b6a4f9a6d
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Virtual Machine

This command provides information about the system manufacturer, product name, serial number, UUID, and other relevant details.

Next, let's display the information about the system's processor:

sudo dmidecode -t processor

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0003, DMI type 3, 21 bytes
Chassis Information
        Manufacturer: VMware, Inc.
        Type: Virtual Machine
        Lock: Not Present
        Version: None
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        Asset Tag: Not Specified
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None

This command provides detailed information about the system's processor, including the manufacturer, model, speed, and other relevant details.

Finally, let's display the information about the system's memory:

sudo dmidecode -t memory

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0017, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x0016
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 16384 MB
        Form Factor: DIMM
        Set: None
        Locator: DIMM 0
        Bank Locator: DIMM 0
        Type: DDR4
        Type Detail: Synchronous
        Speed: 2400 MT/s
        Manufacturer: VMware
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        Asset Tag: Not Specified
        Part Number: VMware Virtual RAM
        Rank: 2
        Configured Memory Speed: 2400 MT/s

This command provides detailed information about the system's memory, including the size, type, speed, and other relevant details.

The dmidecode command can be used to display a wide range of hardware information, and the specific information displayed will depend on the hardware configuration of the system.

Extracting Specific Hardware Details

In this step, we will explore how to use the dmidecode command to extract specific hardware details from the system.

First, let's extract the BIOS information:

sudo dmidecode -t bios

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: 6.00
        Release Date: 12/12/2018
        Address: 0xE8000
        Runtime Size: 128 kB
        ROM Size: 1024 kB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                BIOS ROM is socketed
                EDD is supported
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                Print screen service is supported (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported

This command displays detailed information about the system's BIOS, including the vendor, version, release date, and various BIOS characteristics.

Next, let's extract the information about the system's chassis:

sudo dmidecode -t chassis

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0003, DMI type 3, 21 bytes
Chassis Information
        Manufacturer: VMware, Inc.
        Type: Virtual Machine
        Lock: Not Present
        Version: None
        Serial Number: VMware-42 1d 93 c1 d1 2f 2a 19-5a 1c 4f 3b 6a 4f 9a 6d
        Asset Tag: Not Specified
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None

This command displays information about the system's chassis, including the manufacturer, type, serial number, and various chassis states.

Finally, let's extract the information about the system's slots:

sudo dmidecode -t slot

Example output:

## dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x0008, DMI type 9, 17 bytes
System Slot Information
        Designation: PCI Slot 1
        Type: 32-bit PCI
        Current Usage: Available
        Length: Long
        ID: 1
        Characteristics:
                3.3 V is provided
                PME signal is supported

Handle 0x0009, DMI type 9, 17 bytes
System Slot Information
        Designation: PCI Slot 2
        Type: 32-bit PCI
        Current Usage: Available
        Length: Long
        ID: 2
        Characteristics:
                3.3 V is provided
                PME signal is supported

This command displays information about the system's expansion slots, including the slot designation, type, current usage, and various slot characteristics.

The dmidecode command provides a wealth of detailed hardware information, and the specific information displayed will depend on the hardware configuration of the system.

Summary

In this lab, we introduced the dmidecode command, a powerful tool for retrieving detailed hardware information on Linux systems. We learned that dmidecode can display a wide range of hardware details, including system manufacturer, model name, serial number, BIOS version, processor information, and memory configuration. We also explored how to use the dmidecode command to extract specific hardware details, such as processor information. The lab provided practical examples and step-by-step instructions to help users understand and utilize the dmidecode command effectively.

Linux Commands Cheat Sheet

Other Linux Tutorials you may like