Linux‎ > ‎

dmidecode: examples to get hardware infomation

Thank you for visiting this page, this page has been update in another link Dmidecode examples to get hardware information
Keep it in short
       dmidecode - DMI table decoder

DESCRIPTION
       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.

It's quite useful if you want to know your server's hardware information, particularly most of people want to know memory slot information, or CPU etc.. before system upgrade.

#1, how to get memory slot information, the following commands tell you that this machine has 18 DIMM slots, 8 DIMMs are installed, total 32GB.

# dmidecode  -t memory  | grep "Installed Size" |wc
     18      88     710
# dmidecode  -t memory  | grep "Installed Size"   
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: Not Installed
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: Not Installed
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: Not Installed
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: Not Installed
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
# free
             total       used       free     shared    buffers     cached
Mem:      32933016   32664396     268620          0       2804   23449596
-/+ buffers/cache:    9211996   23721020
Swap:      2008116        824    2007292

For more detail memory info, remove filter,

dmidecode  -t memory

...
Memory Module Information
    Socket Designation: DIMM18
    Bank Connections: 0 0
    Current Speed: Unknown
    Type: DIMM
    Installed Size: 4096 MB (Single-bank Connection)
    Enabled Size: 4096 MB (Single-bank Connection)
    Error Status: OK

Handle 0x002D, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x0009
    Error Information Handle: Not Provided
    Total Width: 72 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: DIMM
    Set: None
    Locator: DIMM18
    Bank Locator: BANK18
    Type: Other
    Type Detail: Unknown
    Speed: 1333 MHz
    Manufacturer: Samsung
    Serial Number: 6084A987
    Asset Tag: Unknown
    Part Number: M393B5170FH0-CH9 
...

In each DIMM description, it has two sections, one for device, the other for Module.

#2, get CPU information, shows each socket detail information, followed by lscpu output which gather cpuinfo from /proc/cpuinfo

# 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)
...
    Version: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
    Voltage: 1.2 V
    External Clock: 6400 MHz
    Max Speed: 4400 MHz
    Current Speed: 2670 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: 6
    Core Enabled: 6
    Thread Count: 6
    Characteristics:
        64-bit capable
...

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                12
On-line CPU(s) list:   0-11
Thread(s) per core:    1
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Stepping:              2
CPU MHz:               1596.000
BogoMIPS:              5333.19
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-5
NUMA node1 CPU(s):     6-11

#3 get system slot information, shows each slot usage info, length type etc..

# dmidecode -t slot
# dmidecode 2.11
SMBIOS 2.5 present.

Handle 0x003E, DMI type 9, 13 bytes
System Slot Information
    Designation: System Slot 1
    Type: x8 PCI Express
    Current Usage: Available
    Length: Long
    ID: 1
    Characteristics:
        3.3 V is provided

Handle 0x003F, DMI type 9, 13 bytes
System Slot Information
    Designation: System Slot 2
    Type: x8 PCI Express
    Current Usage: In Use
    Length: Short
    ID: 2
    Characteristics:
        3.3 V is provided

Handle 0x0040, DMI type 9, 13 bytes
System Slot Information
    Designation: System Slot 3
    Type: x8 PCI Express
    Current Usage: Available
    Length: Long
    ID: 3
    Characteristics:
        3.3 V is provided

Handle 0x0041, DMI type 9, 13 bytes
System Slot Information
    Designation: System Slot 4
    Type: x8 PCI Express
    Current Usage: In Use
    Length: Short
    ID: 4
    Characteristics:
        3.3 V is provided

# dmidecode -t slot | grep -i type
Handle 0x003E, DMI type 9, 13 bytes
    Type: x8 PCI Express
Handle 0x003F, DMI type 9, 13 bytes
    Type: x8 PCI Express
Handle 0x0040, DMI type 9, 13 bytes
    Type: x8 PCI Express
Handle 0x0041, DMI type 9, 13 bytes
    Type: x8 PCI Express

# dmidecode -t slot | grep -i "current usage"
    Current Usage: Available
    Current Usage: In Use
    Current Usage: Available
    Current Usage: In Use
# dmidecode -t slot | grep -i "length"      
    Length: Long
    Length: Short
    Length: Long
    Length: Short

#4 cache infomation, get CPU cache information, L1, L2 and L3

# dmidecode -t cache
# dmidecode 2.11
SMBIOS 2.5 present.

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 1
    Configuration: Enabled, Not Socketed, Level 1
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 32 kB
    Maximum Size: 32 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Data
    Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 2
    Configuration: Enabled, Not Socketed, Level 2
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 256 kB
    Maximum Size: 256 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Unified
    Associativity: 8-way Set-associative

Handle 0x0004, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 3
    Configuration: Enabled, Not Socketed, Level 3
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 12288 kB
    Maximum Size: 12288 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Unified
    Associativity: 16-way Set-associative

Handle 0x0006, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 1
    Configuration: Enabled, Not Socketed, Level 1
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 32 kB
    Maximum Size: 32 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Data
    Associativity: 8-way Set-associative

Handle 0x0007, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 2
    Configuration: Enabled, Not Socketed, Level 2
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 256 kB
    Maximum Size: 256 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Unified
    Associativity: 8-way Set-associative

Handle 0x0008, DMI type 7, 19 bytes
Cache Information
    Socket Designation: Internal Cache Level 3
    Configuration: Enabled, Not Socketed, Level 3
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 12288 kB
    Maximum Size: 12288 kB
    Supported SRAM Types:
        Asynchronous
    Installed SRAM Type: Asynchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Unified
    Associativity: 16-way Set-associative

# dmidecode -t cache | grep "Installed Size"
    Installed Size: 32 kB
    Installed Size: 256 kB
    Installed Size: 12288 kB
    Installed Size: 32 kB
    Installed Size: 256 kB
    Installed Size: 12288 kB
# dmidecode -t cache | grep "Maximum Size"
    Maximum Size: 32 kB
    Maximum Size: 256 kB
    Maximum Size: 12288 kB
    Maximum Size: 32 kB
    Maximum Size: 256 kB
    Maximum Size: 12288 kB

You can compare the cache info with the one from output of lscpu.

The total number of DMI type is 42 +2(which  type  126  is  used  for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data.  dmidecode will display these entries by default, but it can only decode them when the vendors have contributed documentation or code for them)

With option -t, you can either use keyword, or DMI type number, the different is that each keyword is equivalent to a list of type numbers:

       Keyword     Types
       ------------------------------
       bios        0, 13
       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

For example, if you only want to know the memory array information, here is the example

# dmidecode -t 16
# dmidecode 2.11
SMBIOS 2.5 present.

Handle 0x0009, DMI type 16, 15 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: Single-bit ECC
    Maximum Capacity: 192 GB
    Error Information Handle: Not Provided
    Number Of Devices: 18

Here is the list of DMI types

       The SMBIOS specification defines the following DMI types:

       Type   Information
       --------------------------------------------
          0   BIOS
          1   System
          2   Baseboard
          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
         40   Additional Information
         41   Onboard Devices Extended Information
         42   Management Controller Host Interface

Worth to mentioned is that there is an option '-s'
       -s, --string KEYWORD
           Only display the value of the DMI string identified by KEYWORD, and if applicable  a  warning  about  unsupported  SMBIOS  (see below). KEYWORD must be a keyword from the following list: bios-vendor, bios-version, bios-release-date, system-manufacturer, system-product-name, system-version, system-serial-number, system-uuid, baseboard-manufacturer,  baseboard-product-name,  baseboard-version,  baseboard-serial-number,  baseboardasset-tag,  chassis-manufacturer,  chassis-type,  chassis-version, chassisserial-number, chassis-asset-tag, processor-family, processor-manufacturer, processor-version, processor-frequency.  Each  keyword  corresponds  to  a  given  DMI type and a given offset within this entry type.  Not all strings may be meaningful or even defined on all systems. Some keywords may return more than one result on some systems (e.g.  processor-version on a  multi-processor  system).   If KEYWORD is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error.  This option cannot be used more than once.

It doesn't mean too much for command line, but could be handy if you are writing a script for some special purpose.
For example:
#dmidecode -s system-uuid
ADA7B2F2-EE68-3D31-93AF-A0BC66D54B49
#dmidecode -s baseboard-product-name
94Yaaaa
#dmidecode -s baseboard-manufacturer
IBM
#dmidecode -s baseboard-serial-number
1CG078
#dmidecode -s chassis-type          
Rack Mount Chassis
#dmidecode -s processor-family
Xeon MP
Xeon MP
#dmidecode -s processor-frequency
2670 MHz
2670 MHz



More info :

http://www.nongnu.org/dmidecode/





Comments