歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux dmidecode備忘

Linux dmidecode備忘

日期:2017/2/27 15:59:47   编辑:Linux教程

dmidecode

在文章Linux下查看主板的相關信息中已經介紹了該命令查看主板信息的用法,這裡進一步介紹

DMI,即DesktopManagement Interface。也有被稱為SMBIOS,即System Management BIOS。DMI表的意義在於讓我們在不探測硬件實體的情況下獲取硬件的部分信息,方便了用戶,但也同時表明,表中的信息可能是不可靠的。

dmidecode的作用則是將DMI表中的信息用人可以讀懂的方式顯示出來。

最簡單的使用方法,它將顯示dmidecode所能獲取到的全部dmi信息:

# dmidecode

下面列幾個表格:

常用參數

-q 或 --quiet

不顯示太多信息,比如某條數據是從哪裡讀來的等等,為了得到簡潔的信息,此條很有用。

-t 或 --type TYPE

指定要顯示哪方面的內容,很重要,隨後介紹。

-s 或 --string KEYWORD

顯示特定的關鍵字,下面會有介紹。

-u 或 --dump

直接顯示DMI表信息而不解碼,將以16進制的文本方式顯示,對普通用戶意義不大。

-t 或 --type後的文本參數

bios

bios的各項信息

system

系統信息,在我的筆記本上可以看到版本、型號、序號等信息。

baseboard

主板信息

chassis

“底板”,不太理解其含意,期待大家補充

processor

CPU的詳細信息

memory

內存信息,包括目前插的內存條數及大小,支持的單條最大內存和總內存大小等等。

cache

緩存信息,似乎是CPU的緩存信息

connector

在我的電腦是PCI設備的信息

slot

插槽信息

之前筆者由於對該命令不很熟悉,當時使用的是dmidecode結合grep獲取主板信息的,現在獲取就比較方便了
# dmidecode -t
dmidecode: option requires an argument -- t
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot

# dmidecode -t baseboard
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: ASUSTeK Computer INC.
Product Name: P7F-X Series
Version: Rev 1.xxG
Serial Number: 111963010000037
Asset Tag: To Be Filled By O.E.M.
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: To Be Filled By O.E.M.
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0

Handle 0x0036, DMI type 10, 6 bytes
On Board Device Information
Type: Video
Status: Enabled
Description: XGI.Z9S

Handle 0x0037, DMI type 10, 6 bytes
On Board Device Information
Type: SAS Controller
Status: Enabled
Description: Marvell 6145

Handle 0x0038, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: LAN1 Marvell 8056

Handle 0x0039, DMI type 10, 6 bytes
On Board Device Information
Type: Ethernet
Status: Enabled
Description: LAN2 Marvell 8056

Handle 0x0048, DMI type 41, 11 bytes
Onboard Device
Reference Designation: XGI.Z9S
Type: Video
Status: Enabled
Type Instance: 0

Handle 0x0049, DMI type 41, 11 bytes
Onboard Device
Reference Designation: Marvell 6145
Type: SAS Controller
Status: Enabled
Type Instance: 0

Handle 0x004A, DMI type 41, 11 bytes
Onboard Device
Reference Designation: LAN1 Marvell 8056
Type: Ethernet
Status: Enabled
Type Instance: 0

Handle 0x004B, DMI type 41, 11 bytes
Onboard Device
Reference Designation: LAN2 Marvell 8056
Type: Ethernet
Status: Enabled
Type Instance: 0

1、查看服務器型號:dmidecode | grep 'Product Name'
2、查看主板的序列號:dmidecode |grep 'Serial Number'
3、查看系統序列號:dmidecode -s system-serial-number
4、查看內存信息:dmidecode -t memory
5、查看OEM信息:dmidecode -t 11

Copyright © Linux教程網 All Rights Reserved