Compatibility is always a consideration when purchasing new hardware. There have been numerous times I’ve had to find my motherboard’s manufacturer or model to see if a certain feature was available, or how many full PCI-Express x16 slots I had. Years ago, this resulted in me opening my computer and looking for the model on the motherboard with a flashlight.
While this situation at least gave me an excuse to clean the dust from my computer, there is a much, much easier method to find this information straight from the command line.
Enter dmidecode, a tool that reads information directly from sysfs (/sys/) and prints it out to screen in a human-readable format. The following is taken directly from the command’s man page:
dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS ) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.
The DMI table doesn’t only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).
SMBIOS stands for System Management BIOS , while DMI stands for Desktop Management Interface. Both standards are tightly related and developed by the DMTF (Desktop Management Task Force).
As you run it, dmidecode will try to locate the DMI table. If it succeeds, it will then parse this table and display a list of records like this one:
Handle 0x0002, DMI type 2, 8 bytes. Base Board Information Manufacturer: Intel
Product Name: C440GX+
Version: 727281-001
Serial Number: INCY92700942Each record has:
A handle. This is a unique identifier, which allows records to reference each other. For example, processor records usually reference cache memory records using their handles.
A type. The SMBIOS specification defines different types of elements a computer can be made of. In this example, the type is 2, which means that the record contains “Base Board Information”.
A size. Each record has a 4-byte header (2 for the handle, 1 for the type, 1 for the size), the rest is used by the record data. This value doesn’t take text strings into account (these are placed at the end of the record), so the actual length of the record may be (and is often) greater than the displayed value.
Decoded values. The information presented of course depends on the type of record. Here, we learn about the board’s manufacturer, model, version and serial number.
Find it on Amazon
As a quick forewarning, dmidecode does require root-level privileges to access the information it needs. Allowing any user to access hardware-specific information about a system would be a massive security risk!
dmidecode is typically pre-installed on most Linux distributions, but can certainly be installed through all the major repositories if happens not to be installed:
Ubuntu
sudo apt-get -y install dmidecode
RHEL / Fedora
sudo dnf -y install dmidecode
Arch / Manjaro
sudo pacman -S dmidecode
Once installed, getting the system’s motherboard information can be done through the following command:
sudo dmidecode -t 2
# dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 3.3.0 present. Handle 0x0002, DMI type 2, 15 bytes Base Board Information Manufacturer: Gigabyte Technology Co., Ltd. Product Name: X570 AORUS ELITE Version: Default string Serial Number: Default string Asset Tag: Default string Features: Board is a hosting board Board is replaceable Location In Chassis: Default string Chassis Handle: 0x0003 Type: Motherboard Contained Object Handles: 0
This identifies my motherboard as a Gigabyte X570 Aorus Elite. There’s also some additional information listed such as the serial number, the asset tag, and even the location in the chassis, however none of these fields are being utilized in my case.
dmidecode isn’t just limited to motherboard information. By altering the argument (the “2”), information can be found on additional hardware:
Type | Information | Type | Information |
0 | BIOS | 21 | Built-in Pointing Device |
1 | System | 22 | Portable Battery |
2 | Base Board | 23 | System Reset |
3 | Chassis | 24 | Hardware Security |
4 | Processor | 25 | System Power Controls |
5 | Memory Controller | 26 | Voltage Probe |
6 | Memory Module | 27 | Cooling Device |
7 | Cache | 28 | Temperature Probe |
8 | Port Connector | 29 | Electrical Current Probe |
9 | System Slots | 30 | Out-of-band Remote Access |
10 | On-Board Devices | 31 | Boot Integrity Services |
11 | OEM Strings | 32 | System Boot |
12 | System Configuration Options | 33 | 64-bit Memory Error |
13 | BIOS Language | 34 | Management Device |
14 | Group Associations | 35 | Management Device Component |
15 | System Event Log | 36 | Management Device Threshold Data |
16 | Physical Memory Array | 37 | Memory Channel |
17 | Memory Device | 38 | IPMI Device |
18 | 32-bit Memory Error | 39 | Power Supply |
19 | Memory Array Mapped Address | 40 | Additional Information |
20 | Memory Device Mapped Address | 41 | On-board Device |
There are 256 total entries, however anything past 126 is typically disabled or only used in very specific use cases by OEMs.
For example, checking the “Physical Memory Array” (16) will return some basic information on the RAM controller, such as the maximum supported capacity, and whether or not the memory is Error-Correcting:
sudo dmidecode -t 16
# dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 3.3.0 present. Handle 0x000B, DMI type 16, 23 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 128 GB Error Information Handle: 0x000A Number Of Devices: 4
Per the output, the motherboard has four total slots and can support up to 128GB.
In addition to the specific entries from the table above, dmidecode also supports keyword arguments to retrieve information on “groups” of hardware. For a full readout of all motherboard information, the argument “baseboard” could be passed in place of “2” and dmidecode will report back on entries 2, 10, and 41. Not all the hardware types will be supported or return any useful information for all hardware, but dmidecode can still be a great way to quickly reference certains aspects of a system.