| dmidecode以一种可读的方式dump出机器的DMI(Desktop Management Interface)信息。这些信息包括了硬件以及BIOS,既可以得到当前的配置,也可以得到系统支持的最大配置,比如说支持的最大内存数等。 DMI有人也叫SMBIOS(System Management BIOS),这两个标准都由DMTF(Desktop Management Task Force)开发。 dmidecode的使用方法 1. 最简单的的显示全部dmi信息: 2.更精简的信息显示: 3.显示指定类型的信息: dmidecode到底支持哪些type? 4.通过关键字查看信息: 5.示例  # free
    total       used       free     shared    buffers     cached
 Mem:       8182532    8010792     171740          0     148472    4737896
 -/+ buffers/cache:    3124424    5058108
 Swap:      4192956       3304    4189652
 # grep MemTotal /proc/meminfo
 MemTotal:      8182532 kB
这里显示了当前服务器的物理内存是8GB。 服务器到底能扩展到多大的内存? #dmidecode -t 16 # dmidecode 2.7 SMBIOS 2.4 present. Handle 0x0013, DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 64 GB (可扩展到64GB) Error Information Handle: Not Provided Number Of Devices: 4 但是,事实不一定如此,因此插槽可能已经插满了。也就是我们还必须查清这里的8G到底是4*2GB, 2*4GB还是其他? #dmidecode -t 17 # dmidecode 2.7 SMBIOS 2.4 present. Handle 0x0015, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB 【插槽1有1条2GB内存】 Form Factor: DIMM Set: None Locator: DIMM00 Bank Locator: BANK Type: Other Type Detail: Other Speed: 667 MHz (1.5 ns) Manufacturer: Serial Number: BZACSKZ001 Asset Tag: RAM82 Part Number: MT9HTF6472FY-53EA2 Handle 0x0017, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB 【插槽2有1条2GB内存】 Form Factor: DIMM Set: None Locator: DIMM10 Bank Locator: BANK Type: Other Type Detail: Other Speed: 667 MHz (1.5 ns) Manufacturer: Serial Number: BZACSKZ001 Asset Tag: RAM83 Part Number: MT9HTF6472FY-53EA2 Handle 0x0019, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB 【插槽3有1条2GB内存】 Form Factor: DIMM Set: None Locator: DIMM20 Bank Locator: BANK Type: Other Type Detail: Other Speed: 667 MHz (1.5 ns) Manufacturer: Serial Number: BZACSKZ001 Asset Tag: RAM84 Part Number: MT9HTF6472FY-53EA2 Handle 0x001B, DMI type 17, 27 bytes. Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB 【插槽4有1条2GB内存】 Form Factor: DIMM Set: None Locator: DIMM30 Bank Locator: BANK Type: Other Type Detail: Other Speed: 667 MHz (1.5 ns) Manufacturer: Serial Number: BZACSKZ001 Asset Tag: RAM85 Part Number: MT9HTF6472FY-53EA2 根据上面输出可以发现,如果要扩展,只有将上面的内存条换成16GB的,才能达到4*16GB=64GB的最大支持内存。  附录:
 dmidecode支持的数字参数:
 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
[root@localhost ~]# dmidecode |grep -A16 "Memory Device$"
Memory Device
        Array Handle: 0x0019
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 2048 MB
        Form Factor: DIMM
        Set: None
        Locator: A0
        Bank Locator: Bank0/1
        Type: Unknown
        Type Detail: None
        Speed: 800 MHz
        Manufacturer:
        Serial Number:
        Asset Tag:
        Part Number:
--
Memory Device
        Array Handle: 0x0019
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 2048 MB
        Form Factor: DIMM
        Set: None
        Locator: A1
        Bank Locator: Bank2/3
        Type: Unknown
        Type Detail: None
        Speed: 800 MHz
        Manufacturer:
        Serial Number:
        Asset Tag:
        Part Number:
 | 



