dmidecode -- DMI table decoder

It's a tool for dumping a compter'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, without opening a hardware box, particularly for people just want to know memory slot information, or CPU etc.. .

Get memory information

The following commands tell you that this machine has 18 DIMM slots, 8 DIMMs are installed, total 32GB.

# dmidecode  -t memory
It shows the info of Memory array, memory slots, and installed memory modules

# dmidecode  -t memory  | grep "Size" |wc
     18      88     710
# dmidecode  -t memory  | grep "Size"
    Installed Size: Not Installed
    Installed Size: 4096 MB (Single-bank Connection)
    Installed Size: 4096 MB (Single-bank Connection)
...

It's consistent with the amount memory shows in OS

# 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 above output, each DIMM description  has two sections, one for device, the other for Module.

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 output

# 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

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

To filter the output

By type:

# 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

By usage

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

By profile type

# dmidecode -t slot | grep -i "length"
    Length: Long
    Length: Short
    Length: Long
    Length: Short

Get CPU cache infomation

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

Filtered by cache level and size

# dmidecode -t cache | grep -E "Installed Size|Internal Cache"
    Socket Designation: Internal Cache Level 1
    Installed Size: 32 kB
    Socket Designation: Internal Cache Level 2
    Installed Size: 256 kB
    Socket Designation: Internal Cache Level 3
    Installed Size: 12288 kB
    Socket Designation: Internal Cache Level 1
    Installed Size: 32 kB
    Socket Designation: Internal Cache Level 2
    Installed Size: 256 kB
    Socket Designation: Internal Cache Level 3
    Installed Size: 12288 kB

Similariy, you can get each level cache's Maximum Size

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

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

-s, --string KEYWORD option

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:

To get system uuid

#dmidecode -s system-uuid
ADA7B2F2-EE68-3D31-93AF-A0BC66D54B49

To get production name

#dmidecode -s baseboard-product-name
94Yaaaa

Get manufacturer, and so on

#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

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