本文链接:http://codingstandards.iteye.com/blog/788984 (转载请注明出处)
dmidecode命令用来查看硬件信息。第一次看到这个命令,是在IBM的网站上看到的《“懒惰” Linux 管理员的 10 个关键技巧 》的技巧10 - 随机信息收集。在此之前,我们清查机器的硬件信息时,都需要跑到机房才行,而这个机房并不在我们这个城市。DMI ,即Desktop Management Interface。也有被称为SMBIOS,即System Management BIOS。
较低版本的dmidecode命令不支持参数,因此要看信息的话,要用more/less/grep来配合才能更好些。
较高版本的dmidecode命令有如下参数:
-h 查看帮助信息。
-q 不显示未知设备。
-t type 查看指定类型的信息,比如bios,system,memory,processor等。
-s keyword 查看指定的关键字的信息,比如system-manufacturer, system-product-name, system-version, system-serial-number等。
[root@web186 root]# dmidecode
# dmidecode 2.2
[root@web186 root]# man dmidecode
man: 没有那个文件或目录
Failed to open the message catalog man on the path NLSPATH=<none>
No manual entry for dmidecode
[root@web186 root]# lsb_release -a
LSB Version: 1.3
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 3 (Taroon Update 4)
Release: 3
Codename: TaroonUpdate4
[root@web186 root]#
这台机器是台工控机,安装的是RHEL3.4。
[web@hnweb1 ~]$ dmidecode
-bash: dmidecode: command not found
[web@hnweb1 ~]$ whereis dmidecode
dmidecode: /usr/sbin/dmidecode
[web@hnweb1 ~]$ /usr/sbin/dmidecode
/dev/mem: Permission denied
[web@hnweb1 ~]$
[root@sunrise root]# dmidecode
# dmidecode 2.2
SMBIOS 2.4 present.
62 structures occupying 3131 bytes.
Table at 0xCFFBC000.
Handle 0xDA00
DMI type 218, 11 bytes.
OEM-specific Type
Header And Data:
DA 0B 00 DA B2 00 17 00 0E 20 00
Handle 0x0000
DMI type 0, 24 bytes.
BIOS Information
Vendor: Dell Inc.
Version: 1.1.0
Release Date: 06/21/2006
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 1024 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
EDD is supported
Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
5.25"/360 KB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 KB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Function key-initiated network boot is supported
Handle 0x0100
DMI type 1, 27 bytes.
System Information
Manufacturer: Dell Inc.
Product Name: PowerEdge 2950
Version: Not Specified
Serial Number: DYG822X
UUID: 44454C4C-5900-1047-8038-C4C04F323258
Wake-up Type: Power Switch
Handle 0x0200
DMI type 2, 9 bytes.
Base Board Information
Manufacturer: Dell Inc.
Product Name: 0CW954
Version: A00
Serial Number: ..CN137406AU00PR.
Handle 0x0300
DMI type 3, 21 bytes.
Chassis Information
Manufacturer: Dell Inc.
Type: Rack Mount Chassis
Lock: Present
Version: Not Specified
Serial Number: DYG822X
Asset Tag: Not Specified
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: Unknown
OEM Information: 0x00000000
Heigth: 2 U
Number Of Power Cords: Unspecified
Contained Elements: 0
Handle 0x0400
DMI type 4, 40 bytes.
Processor Information
Socket Designation: CPU1
Type: Central Processor
Family: Xeon
Manufacturer: Intel
ID: F6 06 00 00 FF FB EB BF
Signature: Type 0, Family 6, Model F, Stepping 6
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
SBF (Signal break on FERR)
Version: Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
Voltage: 1.4 V
External Clock: 1333 MHz
Max Speed: 3600 MHz
Current Speed: 2000 MHz
Status: Populated, Enabled
Upgrade: <OUT OF SPEC>
L1 Cache Handle: 0x0700
L2 Cache Handle: 0x0701
L3 Cache Handle: 0x0702
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
上面是关于CPU的。
中间省略掉很多输出。
Handle 0x0D00
DMI type 13, 22 bytes.
BIOS Language Information
Installable Languages: 1
en|US|iso8859-1
Currently Installed Language: en|US|iso8859-1
Handle 0x1000
DMI type 16, 15 bytes.
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 32 GB
Error Information Handle: Not Provided
Number Of Devices: 8
Handle 0x1100
DMI type 17, 28 bytes.
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: <OUT OF SPEC>
Set: 1
Locator: DIMM1
Bank Locator: Not Specified
Type: <OUT OF SPEC>
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 855180898551
Serial Number: 050C4921
Asset Tag: 560639
Part Number: 72T128420HFN3SA
上面这一段是关于内存的。
中间省略掉不少输出。
Handle 0x7F00
DMI type 127, 4 bytes.
End Of Table
[root@sunrise root]# dmidecode | grep 'Serial Number' <== 查看机器序列号
Serial Number: DYG822X
Serial Number: ..CN137406AU00PR .
Serial Number: DYG822X
Serial Number: Not Specified
Serial Number: Not Specified
Serial Number: 050C4921
Serial Number: 050C4926
Serial Number: 050C4520
Serial Number: 050C4624
Serial Number:
Serial Number:
Serial Number:
Serial Number:
[root@sunrise root]# dmidecode -t processor
-t: No such file or directory
较低版本的dmidecode不支持-t参数。
[root@sunrise root]# dmidecode -h
-h: No such file or directory
较低版本的dmidecode无法查看帮助信息。
[root@sunrise root]# dmidecode | grep CPU
Socket Designation: CPU1
Version: Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
Socket Designation: CPU2
Version: Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
只能通过grep之类的方式去查询了。
[root@sunrise root]# dmidecode -q
-q: No such file or directory
较低版本的dmidecode不支持-q参数。
[root@sunrise root]#
[root@web ~]# dmidecode -h
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
-h, --help Display this help text and exit
-q, --quiet Less verbose output
-s, --string KEYWORD Only display the value of the given DMI string
-t, --type TYPE Only display the entries of given type
-u, --dump Do not decode the entries
--dump-bin FILE Dump the DMI data to a binary file
--from-dump FILE Read the DMI data from a binary file
-V, --version Display the version and exit
不仅可以通过-h参数看到帮助信息,而且man dmidecode也可以看到手册页。
[root@web ~]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga
[root@web ~]# dmidecode -t processor
# dmidecode 2.10
SMBIOS 2.4 present.
Handle 0x0005, DMI type 4, 35 bytes
Processor Information
Socket Designation: Socket 775
Type: Central Processor
Family: Core 2 Duo
Manufacturer: Intel
ID: F6 06 00 00 FF FB EB BF
Signature: Type 0, Family 6, Model 15, Stepping 6
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Core(TM)2
Voltage: 1.2 V
External Clock: 266 MHz
Max Speed: 4000 MHz
Current Speed: 2394 MHz
Status: Populated, Enabled
Upgrade: ZIF Socket
L1 Cache Handle: 0x000B
L2 Cache Handle: 0x000C
L3 Cache Handle: Not Provided
Serial Number:
Asset Tag:
Part Number:
[root@web ~]#
1. 怎样升级Linux系统上的dmidecode,以便看到详细的硬件信息?
【1】飘渺的风 Linux硬件信息查看工具dmidecode
【2】IBM “懒惰” Linux 管理员的 10 个关键技巧
【3】lamp fans notes Dmidecode linux下 获取一些硬件参数的命令(转)
【4】Linux-Wiki.cn 查看硬件详细信息
【5】Linux纪录地 linux有用但不常用小工具(dmidecode\ethtool\ulimit\等)