UNPKG

9.12 kBMarkdownView Raw
1dmidecode
2===
3
4在Linux系统下获取有关硬件方面的信息
5
6## 补充说明
7
8**dmidecode命令** 可以让你在Linux系统下获取有关硬件方面的信息。dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。dmidecode遵循SMBIOS/DMI标准,其输出的信息包括BIOS、系统、主板、处理器、内存、缓存等等。
9
10DMI(Desktop Management Interface,DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force(DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。
11
12DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format(MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。
13
14### 语法
15
16```shell
17dmidecode [选项]
18```
19
20### 选项
21
22```shell
23-d:(default:/dev/mem)从设备文件读取信息,输出内容与不加参数标准输出相同。
24-h:显示帮助信息。
25-s:只显示指定DMI字符串的信息。(string)
26-t:只显示指定条目的信息。(type)
27-u:显示未解码的原始条目内容。
28--dump-bin file:将DMI数据转储到一个二进制文件中。
29--from-dump FILE:从一个二进制文件读取DMI数据。
30-V:显示版本信息。
31```
32
33 **dmidecode参数string及type列表:**
34
35(1)Valid string keywords are:
36
37* bios-vendor
38* bios-version
39* bios-release-date
40* system-manufacturer
41* system-product-name
42* system-version
43* system-serial-number
44* system-uuid
45* baseboard-manufacturer
46* baseboard-product-name
47* baseboard-version
48* baseboard-serial-number
49* baseboard-asset-tag
50* chassis-manufacturer
51* chassis-type
52* chassis-version
53* chassis-serial-number
54* chassis-asset-tag
55* processor-family
56* processor-manufacturer
57* processor-version
58* processor-frequency
59
60(2)Valid type keywords are:
61
62* bios
63* system
64* baseboard
65* chassis
66* processor
67* memory
68* Cache
69* connector
70* slot
71
72(3)type全部编码列表:
73
74* BIOS
75* System
76* Base Board
77* Chassis
78* Processor
79* Memory Controller
80* Memory Module
81* Cache
82* Port Connector
83* System Slots
84* On Board Devices
85* OEM Strings
86* System Configuration Options
87* BIOS Language
88* Group Associations
89* System Event Log
90* Physical Memory Array
91* Memory Device
92* 32-bit Memory Error
93* Memory Array Mapped Address
94* Memory Device Mapped Address
95* Built-in Pointing Device
96* Portable Battery
97* System Reset
98* Hardware Security
99* System Power Controls
100* Voltage Probe
101* Cooling Device
102* Temperature Probe
103* Electrical Current Probe
104* Out-of-band Remote Access
105* Boot Integrity Services
106* System Boot
107* 64-bit Memory Error
108* Management Device
109* Management Device Component
110* Management Device Threshold Data
111* Memory Channel
112* IPMI Device
113* Power Supply
114* Additional Information
115* Onboard Device
116
117### 实例
118
119```shell
120dmidecode -t 1 # 查看服务器信息
121dmidecode | grep 'Product Name' # 查看服务器型号
122dmidecode |grep 'Serial Number' # 查看主板的序列号
123dmidecode -t 2 # 查看主板信息
124dmidecode -s system-serial-number # 查看系统序列号
125dmidecode -t memory # 查看内存信息
126dmidecode -t 11 # 查看OEM信息
127dmidecode -t 17 # 查看内存条数
128dmidecode -t 16 # 查询内存信息
129dmidecode -t 4 # 查看CPU信息
130
131cat /proc/scsi/scsi # 查看服务器硬盘信息
132```
133
134不带选项执行dmidecode命令通常会输出所有的硬件信息。dmidecode命令有个很有用的选项-t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行:
135
136```shell
137[root@localhost ~]# dmidecode -t processor
138# dmidecode 2.11
139SMBIOS 2.5 present.
140
141Handle 0x0001, DMI type 4, 40 bytes
142Processor Information
143 Socket Designation: Node 1 Socket 1
144 Type: Central Processor
145 Family: Xeon MP
146 Manufacturer: Intel(R) Corporation
147 id: C2 06 02 00 FF FB EB BF
148 Signature: Type 0, Family 6, Model 44, Stepping 2
149 Flags:
150 FPU (Floating-point unit on-chip)
151 VME (Virtual mode extension)
152 DE (Debugging extension)
153 PSE (Page size extension)
154 TSC (time stamp counter)
155 MSR (Model specific registers)
156 PAE (Physical address extension)
157 MCE (Machine check exception)
158 CX8 (CMPXCHG8 instruction supported)
159 APIC (On-chip APIC hardware supported)
160 SEP (Fast system call)
161 MTRR (Memory type range registers)
162 PGE (Page global enable)
163 MCA (Machine check architecture)
164 CMOV (Conditional move instruction supported)
165 PAT (Page attribute table)
166 PSE-36 (36-bit page size extension)
167 CLFSH (CLFLUSH instruction supported)
168 DS (Debug store)
169 ACPI (ACPI supported)
170 MMX (MMX technology supported)
171 FXSR (FXSAVE and FXSTOR instructions supported)
172 SSE (Streaming SIMD extensions)
173 SSE2 (Streaming SIMD extensions 2)
174 ss (Self-snoop)
175 HTT (Multi-threading)
176 TM (Thermal monitor supported)
177 PBE (Pending break enabled)
178 Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
179 Voltage: 1.2 V
180 External Clock: 5866 MHz
181 Max Speed: 4400 MHz
182 Current Speed: 2400 MHz
183 Status: Populated, Enabled
184 Upgrade: ZIF Socket
185 L1 Cache Handle: 0x0002
186 L2 Cache Handle: 0x0003
187 L3 Cache Handle: 0x0004
188 Serial Number: Not Specified
189 Asset Tag: Not Specified
190 Part Number: Not Specified
191 Core Count: 4
192 Core Enabled: 4
193 Thread Count: 8
194 Characteristics:
195 64-bit capable
196
197Handle 0x0055, DMI type 4, 40 bytes
198Processor Information
199 Socket Designation: Node 1 Socket 2
200 Type: Central Processor
201 Family: Xeon MP
202 Manufacturer: Not Specified
203 ID: 00 00 00 00 00 00 00 00
204 Signature: Type 0, Family 0, Model 0, Stepping 0
205 Flags: None
206 Version: Not Specified
207 Voltage: 1.2 V
208 External Clock: 5866 MHz
209 Max Speed: 4400 MHz
210 Current Speed: Unknown
211 Status: Unpopulated
212 Upgrade: ZIF Socket
213 L1 Cache Handle: Not Provided
214 L2 Cache Handle: Not Provided
215 L3 Cache Handle: Not Provided
216 Serial Number: Not Specified
217 Asset Tag: Not Specified
218 Part Number: Not Specified
219 Characteristics: None
220```
221
222查看内存的插槽数,已经使用多少插槽。每条内存多大,已使用内存多大
223
224```shell
225dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
226
227# Size: 2048 MB
228# Size: 2048 MB
229# Size: 4096 MB
230# Size: No Module Installed
231```
232
233查看内存支持的最大内存容量
234
235```shell
236dmidecode|grep -P 'Maximum\s+Capacity'
237
238# Maximum Capacity: 16 GB
239```
240
241查看内存的频率
242
243```shell
244dmidecode|grep -A16 "Memory Device"
245
246# Memory Device
247# Array Handle: 0x1000
248# Error Information Handle: Not Provided
249# Total Width: 72 bits
250# Data Width: 64 bits
251# Size: 2048 MB
252# Form Factor: DIMM
253# Set: 1
254# Locator: DIMM_A1
255# Bank Locator: Not Specified
256# Type: DDR3
257# Type Detail: Synchronous Unbuffered (Unregistered)
258# Speed: 1333 MHz
259# Manufacturer: 00CE000080CE
260# Serial Number: 4830F3E1
261# Asset Tag: 01093200
262# Part Number: M391B5673EH1-CH9
263# --
264# Memory Device
265# Array Handle: 0x1000
266# Error Information Handle: Not Provided
267# Total Width: 72 bits
268# Data Width: 64 bits
269# Size: 2048 MB
270# Form Factor: DIMM
271# Set: 1
272# Locator: DIMM_A2
273# Bank Locator: Not Specified
274# Type: DDR3
275# Type Detail: Synchronous Unbuffered (Unregistered)
276# Speed: 1333 MHz
277# Manufacturer: 00AD000080AD
278# Serial Number: 1BA1F0B5
279# Asset Tag: 01110900
280# Part Number: HMT325U7BFR8C-H9
281# --
282
283dmidecode|grep -A16 "Memory Device"|grep 'Speed'
284
285# Speed: 1333 MHz
286# Speed: 1333 MHz
287# Speed: 1333 MHz
288# Speed: Unknown
289
290```shell
291
292
293
294
\No newline at end of file