Dmidecode简介                      

DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。 SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。

DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format (MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。

dmidecode的输出格式一般如下:              

Handle ×
DMI type , bytes
Base Board Information
Manufacturer:Intel
Product Name: C440GX+
Version: -
Serial Number: INCY92700942

其中的前三行都称为记录头(recoce Header), 其中包括了:

、recode id(handle): DMI表中的记录标识符,这是唯一的,比如上例中的Handle ×。
、dmi type id: 记录的类型,譬如说:BIOS,Memory,上例是type ,即”Base Board Information”
、recode size: DMI表中对应记录的大小,上例为8 bytes.(不包括文本信息,所有实际输出的内容比这个size要更大。)
记录头之后就是记录的值:
、decoded values: 记录值可以是多行的,比如上例显示了主板的制造商(manufacturer)、model、version以及serial Number。

dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。

dmidecode命令用法详解                  

不带选项执行 dmidecode 通常会输出所有的硬件信息。Dmidecode 有个很有用的选项 -t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行

[root@master ~]# 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
[root@master ~]# dmidecode -t processor
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present. Handle 0x0004, DMI type , bytes
Processor Information
Socket Designation: CPU #
Type: Central Processor
Family: Unknown
Manufacturer: GenuineIntel
ID: A7 FF FB AB 0F
Version: Intel(R) Core(TM) i3-2348M CPU @ .30GHz
Voltage: 3.3 V
External Clock: Unknown
Max Speed: MHz
Current Speed: MHz
Status: Populated, Enabled
Upgrade: ZIF Socket
L1 Cache Handle: 0x0094
L2 Cache Handle: 0x0114
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count:
Core Enabled:
Characteristics:
-bit capable
Execute Protection
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
只显示指定DMI字符串的信息
-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
显示版本信息

dmidecode参数string及type列表              

[root@master ~]# dmidecode -s
dmidecode: option requires an argument -- 's'
String keyword expected
Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency
[root@master ~]# 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

查看内存槽数、那个槽位插了内存,大小是多少          

[root@master ~]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
Size: MB

查看最大支持内存数                      

[root@master ~]# dmidecode|grep -P 'Maximum\s+Capacity'
Maximum Capacity: GB

查看槽位上内存的速率,没插就是unknown。          

[root@master ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
Speed: Unknown

以上均是通过dmidecode命令来实现的,具体方法如下:
dmidecode以一种可读的方式dump出机器的DMI(Desktop Management Interface)信息。这些信息包括了硬件以及BIOS,既可以得到当前的配置,也可以得到系统支持的最大配
置,比如说支持的最大内存数等。

DMI有人也叫SMBIOS(System Management BIOS),这两个标准都由DMTF(Desktop Management Task Force)开发。

dmidecode的使用方法                        

1. 最简单的的显示全部dmi信息:

[root@master ~]# dmidecode 

将输出所有的dmi信息。

2.更精简的信息显示:

[root@master ~]# dmidecode -q

-q(–quite) 只显示必要的信息,这个很管用哦。

3.显示指定类型的信息:

通常我只想查看某类型,比如CPU,内存或者磁盘的信息而不是全部的。这可以使用-t(–type TYPE)来指定信息类型:

[root@master ~]# dmidecode -t bios
[root@master ~]# dmidecode -t bios, processor
Invalid type keyword: bios,
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot
[root@master ~]# dmidecode -t 0, 4

dmidecode到底支持哪些type?

这些可以在man dmidecode里面看到:

文本参数支持:
bios, system, baseboard, chassis, processor, memory, cache, connector, slot

4. 通过关键字查看信息:

比如只想查看序列号,可以使用:
代码示例: 

[root@master ~]# dmidecode -s system-serial-number
VMware- 4d b7 f3 1e -b4 a6 1d e3
-s (–string keyword)支持的keyword包括:
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. 下面是一些测试示例。

5.1 查看当前内存和支持的最大内存

Linux下,可以使用free或者查看meminfo来获得当前的物理内存:

代码示例:

[root@master ~]# free
total used free shared buff/cache available
Mem:
Swap:
[root@master ~]# grep MemTotal /proc/meminfo
MemTotal: kB

服务器到底能扩展到多大的内存?

[root@master ~]# dmidecode -t
[root@master ~]# dmidecode 2.7
[root@master ~]# dmidecode -t  |more
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present. Handle 0x01A3, DMI type , bytes
Memory Device
Array Handle: 0x0025
Error Information Handle: No Error
Total Width: bits
Data Width: bits
Size: MB        #有一条512兆的内存条。
Form Factor: DIMM
Set: None
Locator: RAM slot #
Bank Locator: RAM slot #
Type: DRAM
Type Detail: EDO
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Rank: Unknown
Configured Clock Speed: Unknown Handle 0x01A4, DMI type , bytes
Memory Device
Array Handle: 0x0025
Error Information Handle: No Error
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None        #没有内存条
Locator: RAM slot #
Bank Locator: RAM slot #
Type: DRAM
Type Detail: Unknown
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

dmidecode支持的数字参数:

ype  Information
—————————————-
BIOS
System
Base Board
Chassis
Processor
Memory Controller
Memory Module
Cache
Port Connector
System Slots
On Board Devices
OEM Strings
System Configuration Options
BIOS Language
Group Associations
System Event Log
Physical Memory Array
Memory Device
-bit Memory Error
Memory Array Mapped Address
Memory Device Mapped Address
Built-in Pointing Device
Portable Battery
System Reset
Hardware Security
System Power Controls
Voltage Probe
Cooling Device
Temperature Probe
Electrical Current Probe
Out-of-band Remote Access
Boot Integrity Services
System Boot
-bit Memory Error
Management Device
Management Device Component
Management Device Threshold Data
Memory Channel
IPMI Device
Power Supply

Dmidecode命令的更多相关文章

  1. 使用 python 获取 Linux 系统信息(通过dmidecode命令)

    通过 dmidecode 命令可以获取到 Linux 系统的包括 BIOS. CPU.内存等系统的硬件信息,这里使用 python 代码来通过调用 dmidecode 命令来获取 Linux 必要的系 ...

  2. 【转】dmidecode命令详解

    Dmidecode 这款软件允许你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准,其输出的信息包括 BIOS.系统.主板.处理器.内存.缓存等等. ...

  3. linux 查看内存信息,及其他硬件信息 dmidecode命令

    由于想换内存,想看看内存型号.频率,简单搜了下命令 可以用dmidecode 命令查看. dmidecode -t memory 这个命令可以查看内存的几乎所有信息,包括频率 大小等等 另外这个命令强 ...

  4. 如何使用dmidecode命令查看硬件信息

    引言 当我们需要获取机器硬件信息时,可使用linux系统自带的dmidecode工具进行查询. dmidecode命令通过读取系统DMI表,显示服务器硬件和BIOS信息.除了可使用dmidecode查 ...

  5. linux下dmidecode命令获取硬件信息

    linux下dmidecode命令获取硬件信息 2 A+ 所属分类:Linux 运维工具 dmidecode在 Linux 系统下获取有关硬件方面的信息.dmidecode 遵循 SMBIOS/DMI ...

  6. Linux dmidecode 命令

    当我们需要获取机器硬件信息时,可使用linux系统自带的dmidecode工具进行查询. dmidecode 用于获取服务器的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息 这 ...

  7. Linux dmidecode命令

    1.linux系统自带的dmidecode工具查询服务器硬件信息 dmidecode 用于获取服务器的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息 这个命令可以查看内存的几乎 ...

  8. dmidecode 命令

    dmidecode                                                 #  查看全面硬件信息dmidecode | grep "Product ...

  9. linux 命令之 dmidecode

    Dmidecode 这款软件同意你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准.其输出的信息包含 BIOS.系统.主板.处理器.内存.缓存等等. ...

随机推荐

  1. 《高性能MySQL》读后感——聚簇索引

    <高性能MySQL>读后感——聚簇索引 聚簇索引并不是一种单独的索引类型,而是一种数据存储方式.比如,InnoDB的聚簇索引使用B+Tree的数据结构存储索引和数据. 当表有聚簇索引时,它 ...

  2. SQL Server关系的创建

    如果两个表的相关列都是主键或具有唯一约束,创建的就是一对一关系. 如果只有一列具有主键或唯一约束,则创建的时一对多关系 关联字段的字符类型必须相同. 1. 一对一关系 USE [Howie] crea ...

  3. win10 去除快捷方式小箭头

    @echo off color 2 reg delete HKCR\lnkfile /v IsShortcut /f reg delete HKCR\piffile /v IsShortcut /f ...

  4. Vue todos示例 在class中的应用表达式

    本篇博客用到了v-if,v-on,v-for三个没有写到的知识点,以后会详细写三篇博客,详细写这三个方法的用处 直接上代码: <!doctype html> <html lang=& ...

  5. Paper | SkipNet: Learning Dynamic Routing in Convolutional Networks

    目录 1. 概括 2. 相关工作 3. 方法细节 门限模块的结构 训练方法 4. 总结 作者对residual network进行了改进:加入了gating network,基于上一层的激活值,得到一 ...

  6. 海边拾贝-B-优秀博客/网站

    记下若干优秀博客,方便后期检索.会不定期更新: 优秀的程序员,从使用Github开始:https://help.github.com/en/github/managing-your-work-on-g ...

  7. LeetCode 141:环形链表 Linked List Cycle

    给定一个链表,判断链表中是否有环. 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始). 如果 pos 是 -1,则在该链表中没有环. Given a l ...

  8. 四、Srping之Bean的初始化和销毁

    Srping之Bean的初始化和销毁方法 通常,bean的初始化和销毁方法我们有三个地方可以入手,分别是: 自定义初始化,销毁方法 实现spring提供的InitializingBean(初始化逻辑) ...

  9. CMPT 300 – Operating Systems

    Assignment 4 – Create Simple YetFunctional File SystemCMPT 300 – Operating SystemsPlease submit a zi ...

  10. 基于仿射的非刚体配准方法(i) 法向

    为啥闲呢,因为work干完了. 为啥补档呢,因为有新work了. 呃,因为新work让人自闭. 我现在干完了两部分.一是把最近邻的部分迁移过来. 二是求法向. 首先是给三个点,就能确定平面——因为是三 ...