在linux系統環境下(CentOS 6.4和Ubuntu 12.04已確認),可以使用dmicode命令查看硬件設備的詳細信息。
具體命令格式為:dmidecode -t typecode
其中typecode是設備類型代碼,具體代碼如下:
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
比如,使用dmidecode -t 1 可以查看主板信息(制造商、型號、序列號等等)
使用dmidecode -t 4 可以查看CPU信息(CPU數目、型號、大小、頻率等等)
使用dmidecode -t 17 可以查看內存信息(插槽數目、內存類型、大小、頻率等等)
不過,貌似沒法查看硬盤的信息。硬盤的信息可以通過如下命令查看: dmesg | grep sda 得到的信息比較少,只有總大小和block大小。 cat /proc/scsi/scsi 可以得到scsi控制器相關的信息