linux command to obtain hardware information under dmidecode

dmidecode get information about the hardware in the Linux system. dmidecode follow SMBIOS / DMI standard, in a machine-readable way to dump the DMI (Desktop Management Interface) information, the output information includes BIOS, System, board, processor, memory, cache and the like, this may be obtained configuration, you can also get a maximum configuration supported by the system, such as the maximum number of support such as memory.
aptitude install dmidecode # Debian/Ubuntu
yum install dmidecode # Fedora
pacman -S dmidecode # Arch Linux
emerge -av dmidecode # Gentoo
1, view the number of memory slot, insert the memory slot, the size is the number
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
2, view the number of maximum memory support
dmidecode|grep -P 'Maximum\s+Capacity'
3. Check the memory slot rate, no plug is unknown.
dmidecode|grep -A16 "Memory Device"|grep 'Speed'
dmidecode output format is generally as follows:
Handle 0×0002
DMI type 2, 8 bytes
Base Board Information
Manufacturer:Intel
Product Name: C440GX+
Version: 727281-0001
Serial Number: INCY92700942
Wherein the first three rows called a recording head (recoce Header), which include: 1, recode id (handle): DMI table record identifier, which is unique, such as the embodiment of the Handle 0 × 0002. 2, dmi type id: the type of record, say: BIOS, Memory, the example is type 2, i.e., "Base Board Information" 3, recode size:. DMI table corresponding to the size of the recording, and the embodiment is 8 bytes (not including text information, all the contents to be actually output is larger than this size) is the value of the recording after the recording head:. 4, decoded values: value may be recorded in a plurality of rows, such as the example shows motherboard manufacturer (manufacturer) , model, version and serial Number. 1. dmidecode using the simplest of all dmi display information:
# dmidecode
This will put all dmi information, you might be frightened a lot of information, you can usually use the following method. 2. A more streamlined information display:
# dmidecode -q
-q (-quite) displaying only the necessary information, this is very useful oh. 3. Display the specified types of information: I usually want to see only certain types of information such as CPU, memory or disk but not all. This can be -t (-type TYPE) to specify the types of information:
# dmidecode -t bios
# dmidecode -t bios, processor (这种方式好像不可以用,必须用下面的数字的方式)
# dmidecode -t 0,4 (显示bios和processor)
dmidecode in the end support which can be seen in these type man dmidecode inside:? Text parameter support: bios, system, baseboard, chassis, processor, memory, cache, connector, slot supports a number of digital parameters :( See appendix) 4. By Keyword View information: for example, only want to see the serial number, you can use:
# dmidecode -s system-serial-number
-s (-string keyword) supports 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.
5. Examples 5.1 to view the current memory and maximum memory supported by 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 the current server's physical memory is 8GB. It can be extended to a server in the end how much memory?
#dmidecode -t 16
# dmidecode 2.7
SMBIOS 2.4 present.

Handle 0×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 (可扩展到64GB)
Error Information Handle: Not Provided
Number Of Devices: 4
However, the fact is not necessarily the case, so the slot may have been studded. That is, we must also find out in the end is here 8G 4 * 2GB, 2 * 4GB or something else? If it is 4 * 2GB, although it can be extended to 64GB, but the slot was filled already, it can not be extended:
#dmidecode -t 17
# dmidecode 2.7
SMBIOS 2.4 present.

Handle 0×0015, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
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 0×0017, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
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 0×0019, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
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: 0×0013
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
According to the above output it can be found, if you want to extend only into the upper memory 16GB in order to achieve the maximum memory support of 4 * 16GB = 64GB. Appendix: dmidecode supported digital parameters: 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

转载请注明出处:http://www.ttlsa.com/html/1708.html

Reproduced in: https: //my.oschina.net/766/blog/211455

Guess you like

Origin blog.csdn.net/weixin_34268579/article/details/91546886