How to Get Hardware Information with Dmidecode Command on Linux
In this article we’ll see how we can use Dmidecode command to retrieve hardware information of any Linux system. Suppose if we want to upgrade a system we need to gather information like Memory, BIOS and CPU etc. With help of Dmidecode command we will come to know the details without opening system chasis. Dmidecode command works for RHEL/Almalinux/Fedora/Ubuntu Linux.
dmidecode
is a command-line tool in Linux used to retrieve hardware information directly from the system’s Desktop Management Interface (DMI) table. It allows you to view details about your system’s hardware components, such as BIOS version, processor, memory, cache, and system serial numbers, without having to open the system casing.
1. Basic Output of Demidecode
Below is the Demidecode command sample output.
2. How to Get DMI Types
DMI Id give us particular hardware information of system. Dmidecode with options ‘-t ‘or ‘–type‘ and ‘Id‘ will provide us the exact infromation. Id 6 will give us Memory Module information.
Following are the DMI types details.
Type Information ---------------------------------------- 0 BIOS 1 System 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 Associations 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
Instead of going with ‘type_id‘ you can also use keyword with ‘-t‘ argument to the dmidecode command. Following are the list of available keywords.
Keyword Types ------------------------------ bios 0, 13 system 1, 12, 15, 23, 32 baseboard 2, 10 chassis 3 processor 4 memory 5, 6, 16, 17 cache 7 connector 8 slot 9
For example, to get the Cache information on system, you can execute below command instead of Id 7.
3. How to Get Memory Information
How do i get Memory information on system and how much memory is supported by system? The following command shows that the system can support maximum 32GB of RAM.
Note: From the keyword list the memory related information IDs are 5, 6, 16 and 17.
4. How Do I Get BIOS information?
To get the BIOS information of the system, run the following command with ‘-t’ option.
5. How Do I Get the Manufacturer, Model and Serial Number?
To get the information about Manufacturer, Model and Serial Number of system, use the following command as shown below.
Please run ‘man dmidecode‘ from terminal or command prompt to know more about dmidecode.
I hope this article will explained how to use dmidecode command. To know about configuration of sql server to listen on a specific port click here.