Get information about hardware under Linux system
dmidecode command allows you to obtain information about hardware under Linux system. The function of dmidecode is to decode the information in the DMI database and display it in readable text. Since DMI information can be modified manually, the information inside may not be accurate information of the system. dmidecode follows the SMBIOS/DMI standard, and the information it outputs includes BIOS, system, motherboard, processor, memory, cache, etc.
DMI (Desktop Management Interface, DMI) is a management system that helps collect computer system information. The collection of DMI information must be carried out in strict compliance with SMBIOS specifications. SMBIOS (System Management BIOS) is a unified specification that motherboard or system manufacturers need to follow to display product management information in a standard format. SMBIOS and DMI are open technical standards drafted by the industry guidance organization Desktop Management Task Force (DMTF). The DMI design is suitable for any platform and operating system.
DMI acts as the interface between management tools and system layers. It establishes a standard manageable system to make it easier for computer manufacturers and users to understand the system. The main component of DMI is the Management Information Format (MIF) database. This database contains all information about computer systems and accessories. Through DMI, users can obtain serial numbers, computer manufacturers, serial port information and other system accessories information.
dmidecode [options]
-d: (default:/dev/mem) Read information from the device file, and the output content is the same as the standard output without parameters.
-h: Display help information.
-s: Only display the information of the specified DMI string. (string)
-t: Only display information about the specified entry. (type)
-u: Display the undecoded raw entry contents.
--dump-bin file: Dump DMI data into a binary file.
--from-dump FILE: Read DMI data from a binary file.
-V: Display version information.
dmidecode parameter string and type list:
(1) Valid string keywords are:
(2) Valid type keywords are:
*bios
(3) All encoding list of type:
*BIOS *System *Base Board
dmidecode -t 1 # View server information
dmidecode | grep 'Product Name' # View server model
dmidecode |grep 'Serial Number' # Check the serial number of the motherboard
dmidecode -t 2 # View motherboard information
dmidecode -s system-serial-number # View the system serial number
dmidecode -t memory # View memory information
dmidecode -t 11 # View OEM information
dmidecode -t 17 # Check the number of memory sticks
dmidecode -t 16 # Query memory information
dmidecode -t 4 # View CPU information
cat /proc/scsi/scsi # View server hard disk information
Executing the dmidecode command without options will usually output all hardware information. The dmidecode command has a very useful option -t, which can output relevant information according to the specified type. If you want to obtain processor information, you can execute:
[root@localhost ~]# dmidecode -t processor
#dmidecode 2.11
SMBIOS 2.5 present.
Handle 0x0001, DMI type 4, 40 bytes
Processor Information
Socket Designation: Node 1 Socket 1
Type: Central Processor
Family: Xeon MP
Manufacturer: Intel(R) Corporation
id: C2 06 02 00 FF FB EB BF
Signature: Type 0, Family 6, Model 44, Stepping 2
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (FXSAVE and FXSTOR instructions supported)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
ss (Self-snoop)
HTT (Multi-threading)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
Voltage: 1.2 V
External clock: 5866 MHz
Max Speed: 4400 MHz
Current Speed: 2400 MHz
Status: Populated, Enabled
Upgrade: ZIF Socket
L1 Cache Handle: 0x0002
L2 Cache Handle: 0x0003
L3 Cache Handle: 0x0004
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count: 4
Core Enabled: 4
Thread Count: 8
Characteristics:
64-bit capable
Handle 0x0055, DMI type 4, 40 bytes
Processor Information
Socket Designation: Node 1 Socket 2
Type: Central Processor
Family: Xeon MP
Manufacturer: Not Specified
ID: 00 00 00 00 00 00 00 00
Signature: Type 0, Family 0, Model 0, Stepping 0
Flags: None
Version: Not Specified
Voltage: 1.2 V
External clock: 5866 MHz
Max Speed: 4400 MHz
Current Speed: Unknown
Status: Unpopulated
Upgrade: ZIF Socket
L1 Cache Handle: Not Provided
L2 Cache Handle: Not Provided
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Characteristics: None
Check the number of memory slots and how many slots are used. How big is each memory and how much used memory is
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
# Size: 2048 MB
# Size: 2048 MB
# Size: 4096 MB
# Size: No Module Installed
Check the maximum memory capacity supported by the memory
dmidecode|grep -P 'Maximum\s+Capacity'
# Maximum Capacity: 16 GB
Check memory frequency
dmidecode|grep -A16 "Memory Device"
# Memory Device
# Array Handle: 0x1000
# Error Information Handle: Not Provided
# Total Width: 72 bits
# Data Width: 64 bits
# Size: 2048 MB
# Form Factor: DIMM
# Set: 1
# Locator: DIMM_A1
# Bank Locator: Not Specified
# Type: DDR3
# Type Detail: Synchronous Unbuffered (Unregistered)
# Speed: 1333 MHz
# Manufacturer: 00CE000080CE
# Serial Number: 4830F3E1
# Asset Tag: 01093200
# Part Number: M391B5673EH1-CH9
# --
# Memory Device
# Array Handle: 0x1000
# Error Information Handle: Not Provided
# Total Width: 72 bits
# Data Width: 64 bits
# Size: 2048 MB
# Form Factor: DIMM
# Set: 1
# Locator: DIMM_A2
# Bank Locator: Not Specified
# Type: DDR3
# Type Detail: Synchronous Unbuffered (Unregistered)
# Speed: 1333 MHz
# Manufacturer: 00AD000080AD
# Serial Number: 1BA1F0B5
# Asset Tag: 01110900
# Part Number: HMT325U7BFR8C-H9
# --
dmidecode|grep -A16 "Memory Device"|grep 'Speed'
# Speed: 1333 MHz
# Speed: 1333 MHz
# Speed: 1333 MHz
#Speed: Unknown
```shell