linux command dmidecode method to view motherboard memory slots with memory information

  • 2020-05-13 04:17:48
  • OfStack

1. Check the number of memory slots and the size of the memory slot


dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range

2. View the maximum supported memory


dmidecode|grep -P 'Maximum\s+Capacity'

3. Check the memory rate in the slot. If it is not inserted, it is unknown.


dmidecode|grep -A16 "Memory Device"|grep 'Speed'

In fact, the above values are achieved through the dmidecode command. The specific method is as follows:

dmidecode produces the machine's DMI(Desktop Management Interface) information in a readable manner.

This information includes the hardware and BIOS, which can get the current configuration as well as the maximum configuration supported by the system, such as the maximum amount of memory supported.

DMI is also known as SMBIOS(System Management BIOS). Both standards were developed by DMTF(Desktop Management Task Force).

The output format of dmidecode is as follows:


Handle 0 x 0002
DMI type 2, 8 bytes
Base Board Information
Manufacturer:Intel
Product Name: C440GX+
Version: 727281-0001
Serial Number: INCY92700942

The first three lines are called record headers (recoce Header) and include:

1. recode id(handle): the record identifier in DMI table, which is only 1, such as Handle 0×0002 in the example above.

2. dmi type id: type of record, e.g. BIOS, Memory, type 2, Base Board Information

3. recode size: the size of the corresponding record in the DMI table, as shown in the example 8 bytes. (excluding the text information, all the actual output is larger than this size.)

After the record header is the value of the record:

4. decoded values: the record value can be multiple lines, for example, the above example shows the manufacturer of the motherboard (manufacturer), model, version and serial Number.

Usage of dmidecode

1. The simplest way to display all dmi information:


# dmidecode

This will output all of the dmi information, and you might be freaked out by the large amount of information. You can usually use the following method.

2. More concise information display:


# dmidecode -q

-q displays only the necessary information. It works.

3. Display the specified type of information:

Usually I only want to see certain types, such as CPU, memory or disk information, but not all of them. This can be used with -t to specify the information type:


# dmidecode -t bios
# dmidecode -t bios, processor ( This does not seem to work, must use the following Numbers )
# dmidecode -t 0,4 ( According to bios and processor)

What exactly does dmidecode support?

These can be seen in man dmidecode:

Text parameter support:

bios, system, baseboard, chassis, processor, memory, cache, connector, slot

Many digital parameters are supported (see appendix)

4. View information by keyword:

For example, if you only want to see the serial number, you can use:


# dmidecode -s system-serial-number
-s ( � string keyword) To support the keyword Include: 
bios-vendor,bios-version, bios-release-date,
system-manufacturer, system-product-name, system-version, system-serial-number,
baseboard-manu-facturer,baseboard-product-name, baseboard-version, baseboard-serial-number, baseboard-asset-tag,
chassis-manufacturer, chas-sis-version, chassis-serial-number, chassis-asset-tag,
processor-manufacturer, processor-version.

Example 5.

5.1 view current memory and supported maximum memory

Under Linux, you can use free or view meminfo to get the current physical memory:


# 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

This shows that the physical memory of the current server is 8GB.

How much memory can a server scale?


#dmidecode -t 16
# dmidecode 2.7
SMBIOS 2.4 present.

Handle 0 x 0013, 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  (can be extended to 64GB ) 
Error Information Handle: Not Provided
Number Of Devices: 4

However, this does not have to be the case, so the slots may be full. So we also have to figure out is 8G 4*2GB, 2*4GB or something else?

If it is 4*2GB, then although it can be extended to 64GB, the slot is full and cannot be extended:


dmidecode|grep -P 'Maximum\s+Capacity'
0

According to the above output, if you want to expand, you can only reach the maximum supported memory of 4*16GB=64GB if you change the memory bar above to 16GB.

Appendix:

Number parameters supported by dmidecode:


dmidecode|grep -P 'Maximum\s+Capacity'
1

Related articles: