Linux dmidecode命令的使用
github访问、谷歌浏览器搜索、看Youtube视频必备网站:SockBoom
或者网址:https://sockboom.cool/auth/register?affid=212828
一、dmidecode简介
dmidecode是Linux系统中自带的硬件查询工具;dmidecode的作用是将DMI数据库中的信息进行解码,然后以可读的方式显示。DMI(Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须严格按照SMBIOS规范的前提下进行。SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性技术标准,其中DMI设计适用于任何的平台和操作系统。通过DMI,用户可以获取服务器的序列号、电脑厂商、串口信息以及其他的系统配件信息。
二、语法与使用
2.1 使用
dmidecode [选项]
2.2 选项
-d: (default : /dev/mem) 从设备文件读取信息,输出内容与不加参数标准输出相同
-h: 显示帮助信息
-s: 只显示指定DMI字符串的信息
-t: 只显示指定条目的信息
-u: 显示未解码的原始条目内容
--dump-bin file: 将DMI数据转储到二进制文件中
--from-bin file: 从二进制文件读取DMI数据
-V: 显示版本信息
[root@localhost ~]$ dmidecode # 打印所有硬件信息
[root@localhost ~]$ dmidecode -q # 打印所有硬件信息,比较简洁
[root@localhost ~]$ dmidecode | grep 'Product Name' # 以过滤的方式来查看指定的硬件信息# (查看服务器型号)
[root@localhost ~]$ dmidecode -t bios # 查看BIOS相关的硬件信息
[root@localhost ~]$ dmidecode -t system # 查看系统相关的硬件信息
[root@localhost ~]$ dmidecode -t baseboard # 查看主板相关的硬件信息
[root@localhost ~]$ dmidecode -t chassis # 查看机箱相关的硬件信息
[root@localhost ~]$ dmidecode -t processor # 查看处理器相关的硬件信息
[root@localhost ~]$ dmidecode -t memory # 查看内存相关的硬件信息
[root@localhost ~]$dmidecode |grep 'Serial Number' # 查看主板的序列号
[root@localhost ~]$dmidecode -s system-serial-number # 查看系统序列号
[root@localhost ~]$dmidecode -t 11 # 查看OEM信息
2.3 主要用法
2.3.1 查询内存条条数
dmidecode -t 17 | grep "Size.*MB" | wc -l
2.3.2 查看主板信息
dmidecode -t 2 或者 dmidecode -t baseboard
结果:
[root@mysql ~]#dmidecode -t 2
# dmidecode 2.12
SMBIOS 2.5 present.Handle 0x0002, DMI type 2, 15 bytes
Base Board InformationManufacturer: ASUSTeK Computer INC.Product Name: Z8NR-D12Version: Rev 1.xxGSerial Number: 120902356500037Asset Tag: To Be Filled By O.E.M.Features:Board is a hosting boardBoard is replaceableLocation In Chassis: To Be Filled By O.E.M.Chassis Handle: 0x0003Type: MotherboardContained Object Handles: 0
2.3.3 查询内存信息
# 查询服务器支持的最大内存
dmidecode -t 16
[root@mysql ~]#dmidecode -t 16
# dmidecode 2.12
SMBIOS 2.5 present.Handle 0x0036, DMI type 16, 15 bytes
Physical Memory ArrayLocation: System Board Or MotherboardUse: System MemoryError Correction Type: Multi-bit ECCMaximum Capacity: 96 GBError Information Handle: Not ProvidedNumber Of Devices: 12
从这里可以看到服务器最大的支持内存为96G
然后使用以下命令查询机器可用的内存:
grep MemTotal /proc/meminfo
MemTotal: 32869848 kB
可以看到机器可用的内存为32G,也即我们可以再扩64G内存。
2.3.4 查看当前内存数和插槽数
dmidecode|grep -P -A5 "Memory Device" | grep Size
[root@mysql ~]#dmidecode|grep -P -A5 "Memory Device" |grep SizeSize: 16384 MBRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: 16384 MBRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 4032 GBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kBSize: No Module InstalledRange Size: 1 kB
2.3.5 查看物理CPU信息
dmidecode -t 4 或者 cat /proc/cpuinfo
[root@mysql ~]# dmidecode -t 4
# dmidecode 2.12
SMBIOS 2.5 present.Handle 0x0004, DMI type 4, 40 bytes
Processor InformationSocket Designation: CPU 1Type: Central ProcessorFamily: XeonManufacturer: Intel ID: C2 06 02 00 FF FB EB BFSignature: Type 0, Family 6, Model 44, Stepping 2Flags: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 (FXSAVE and FXSTOR instructions supported)SSE (Streaming SIMD extensions)SSE2 (Streaming SIMD extensions 2)SS (Self-snoop)HTT (Multi-threading)TM (Thermal monitor supported)PBE (Pending break enabled)Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz Voltage: 1.2 VExternal Clock: 133 MHzMax Speed: 3600 MHzCurrent Speed: 2400 MHzStatus: Populated, EnabledUpgrade: Socket LGA1366L1 Cache Handle: 0x0005L2 Cache Handle: 0x0006L3 Cache Handle: 0x0007Serial Number: To Be Filled By O.E.M.Asset Tag: To Be Filled By O.E.M.Part Number: To Be Filled By O.E.M.Core Count: 4Core Enabled: 4Thread Count: 8Characteristics:64-bit capableHandle 0x0008, DMI type 4, 40 bytes
Processor InformationSocket Designation: CPU 2Type: Central ProcessorFamily: XeonManufacturer: Intel ID: C2 06 02 00 FF FB EB BFSignature: Type 0, Family 6, Model 44, Stepping 2Flags: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 (FXSAVE and FXSTOR instructions supported)SSE (Streaming SIMD extensions)SSE2 (Streaming SIMD extensions 2)SS (Self-snoop)HTT (Multi-threading)TM (Thermal monitor supported)PBE (Pending break enabled)Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz Voltage: 1.2 VExternal Clock: 133 MHzMax Speed: 3600 MHzCurrent Speed: 2400 MHzStatus: Populated, EnabledUpgrade: Socket LGA1366L1 Cache Handle: 0x0009L2 Cache Handle: 0x000AL3 Cache Handle: 0x000BSerial Number: To Be Filled By O.E.M.Asset Tag: To Be Filled By O.E.M.Part Number: To Be Filled By O.E.M.Core Count: 4Core Enabled: 4Thread Count: 8Characteristics:64-bit capable
2.3.6 查看服务器硬件信息
cat /proc/scsi
[root@mysql ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 01 Id: 00 Lun: 00Vendor: LSI Model: Logical Volume Rev: 3000Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 00Vendor: SEAGATE Model: ST3300657SS Rev: 0008Type: Direct-Access ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00Vendor: SEAGATE Model: ST3300657SS Rev: 0008Type: Direct-Access ANSI SCSI revision: 05
Host: scsi4 Channel: 00 Id: 00 Lun: 00Vendor: TSSTcorp Model: CDDVDW SN-208BB Rev: AS01Type: CD-ROM ANSI SCSI revision: 05
2.3.7 查看内存速率
dmidecode|grep -A16 "Memory Device"|grep 'Speed'
[root@mysql ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'Speed: 1333 MHzSpeed: UnknownSpeed: UnknownSpeed: UnknownSpeed: UnknownSpeed: UnknownSpeed: 1333 MHzSpeed: UnknownSpeed: UnknownSpeed: UnknownSpeed: UnknownSpeed: Unknown
没插就是Unknown
2.3.8 查看系统相关的硬件信息
dmidecode -t 1 或者 dmidecode -t system
dmidecode -t 1
# dmidecode 2.12
SMBIOS 2.5 present.Handle 0x0001, DMI type 1, 27 bytes
System InformationManufacturer: System manufacturerProduct Name: System Product NameVersion: System VersionSerial Number: System Serial NumberUUID: 00797DF5-8DFE-D511-A89C-3085A9A895F8Wake-up Type: Power SwitchSKU Number: To Be Filled By O.E.M.Family: To Be Filled By O.E.M.
另外也可通过/proc查询CPU相关信息。# 查询物理CPU个数:
[root@mysql ~]#cat /proc/cpuinfo |grep 'physical id'|sort|uniq|wc -l
2# 查询CPU核数:
[root@mysql ~]#cat /proc/cpuinfo |grep 'core id'|wc -l
16
2.4 更精简的信息显示
dmidecode -q
//BIOS相关的硬件信息
BIOS InformationVendor: American Megatrends Inc.Version: 1501 Release Date: 10/25/2011Address: 0xF0000Runtime Size: 64 kBROM Size: 2048 kBCharacteristics:ISA is supportedPCI is supportedPNP is supportedAPM is supportedBIOS is upgradeableBIOS shadowing is allowedESCD support is availableBoot from CD is supportedSelectable boot is supportedBIOS ROM is socketedEDD is supported5.25"/1.2 MB floppy services are supported (int 13h)3.5"/720 kB floppy services are supported (int 13h)3.5"/2.88 MB 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 supportedUSB legacy is supportedLS-120 boot is supportedATAPI Zip drive boot is supportedBIOS boot specification is supportedTargeted content distribution is supportedBIOS Revision: 8.15//系统相关的硬件信息
System InformationManufacturer: System manufacturer # 厂商Product Name: System Product Name # 服务器型号Version: System Version # 版本号Serial Number: System Serial Number # 主板序列号UUID: 00797DF5-8DFE-D511-A89C-3085A9A895F8 # UUIDWake-up Type: Power SwitchSKU Number: To Be Filled By O.E.M.Family: To Be Filled By O.E.M.Base Board InformationManufacturer: ASUSTeK Computer INC.Product Name: Z8NR-D12Version: Rev 1.xxGSerial Number: 120902356500037Asset Tag: To Be Filled By O.E.M.Features:Board is a hosting boardBoard is replaceableLocation In Chassis: To Be Filled By O.E.M.Type: Motherboard//机箱相关的硬件信息
Chassis InformationManufacturer: Chassis ManufactureType: DesktopLock: Not PresentVersion: Chassis VersionSerial Number: Chassis Serial NumberAsset Tag: Asset-1234567890Boot-up State: SafePower Supply State: SafeThermal State: SafeSecurity Status: NoneOEM Information: 0x00000001Height: UnspecifiedNumber Of Power Cords: 1Contained Elements: 0//处理器相关的硬件信息
Processor InformationSocket Designation: CPU 1Type: Central ProcessorFamily: XeonManufacturer: Intel ID: C2 06 02 00 FF FB EB BFSignature: Type 0, Family 6, Model 44, Stepping 2Flags: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 (FXSAVE and FXSTOR instructions supported)SSE (Streaming SIMD extensions)SSE2 (Streaming SIMD extensions 2)SS (Self-snoop)HTT (Multi-threading)TM (Thermal monitor supported)PBE (Pending break enabled)Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz Voltage: 1.2 VExternal Clock: 133 MHzMax Speed: 3600 MHzCurrent Speed: 2400 MHzStatus: Populated, EnabledUpgrade: Socket LGA1366Serial Number: To Be Filled By O.E.M.Asset Tag: To Be Filled By O.E.M.Part Number: To Be Filled By O.E.M.Core Count: 4Core Enabled: 4Thread Count: 8Characteristics:64-bit capableCache InformationSocket Designation: L1-CacheConfiguration: Enabled, Not Socketed, Level 1Operational Mode: Write ThroughLocation: InternalInstalled Size: 256 kBMaximum Size: 256 kBSupported SRAM Types:OtherInstalled SRAM Type: OtherSpeed: UnknownError Correction Type: ParitySystem Type: InstructionAssociativity: 4-way Set-associativeProcessor InformationSocket Designation: CPU 2Type: Central ProcessorFamily: XeonManufacturer: Intel ID: C2 06 02 00 FF FB EB BFSignature: Type 0, Family 6, Model 44, Stepping 2Flags: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 (FXSAVE and FXSTOR instructions supported)SSE (Streaming SIMD extensions)SSE2 (Streaming SIMD extensions 2)SS (Self-snoop)HTT (Multi-threading)TM (Thermal monitor supported)PBE (Pending break enabled)Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz Voltage: 1.2 VExternal Clock: 133 MHzMax Speed: 3600 MHzCurrent Speed: 2400 MHzStatus: Populated, EnabledUpgrade: Socket LGA1366Serial Number: To Be Filled By O.E.M.Asset Tag: To Be Filled By O.E.M.Part Number: To Be Filled By O.E.M.Core Count: 4Core Enabled: 4Thread Count: 8Characteristics:64-bit capableCache InformationSocket Designation: L1-CacheConfiguration: Enabled, Not Socketed, Level 1Operational Mode: Write ThroughLocation: InternalInstalled Size: 256 kBMaximum Size: 256 kBSupported SRAM Types:OtherInstalled SRAM Type: OtherSpeed: UnknownError Correction Type: ParitySystem Type: InstructionAssociativity: 4-way Set-associativePort Connector InformationInternal Reference Designator: NullInternal Connector Type: NoneExternal Reference Designator: PS2MouseExternal Connector Type: PS/2Port Type: Mouse PortPort Connector InformationInternal Reference Designator: NullInternal Connector Type: NoneExternal Reference Designator: KeyboardExternal Connector Type: PS/2Port Type: Keyboard PortPort Connector InformationInternal Reference Designator: NullInternal Connector Type: NoneExternal Reference Designator: USB1External Connector Type: Access Bus (USB)Port Type: USBSystem Slot InformationDesignation: PCIE1Type: x16 PCI ExpressCurrent Usage: AvailableLength: ShortID: 1Characteristics:3.3 V is providedOpening is sharedPME signal is supportedSystem Slot InformationDesignation: PCIE2Type: x4 PCI ExpressCurrent Usage: AvailableLength: ShortID: 2Characteristics:3.3 V is providedOpening is sharedPME signal is supportedOn Board Device InformationType: VideoStatus: EnabledDescription: AST2050OEM StringsString 1: To Be Filled By O.E.M.String 2: To Be Filled By O.E.M.String 3: To Be Filled By O.E.M.String 4: To Be Filled By O.E.M.BIOS Language InformationLanguage Description Format: AbbreviatedInstallable Languages: 1en|US|iso8859-1Currently Installed Language: en|US|iso8859-1System Event LogArea Length: 1008 bytesHeader Start Offset: 0x0810Data Start Offset: 0x0810Access Method: Memory-mapped physical 32-bit addressAccess Address: 0xFFFBC000Status: Valid, Not FullChange Token: 0x00000000Header Format: No HeaderSupported Log Type Descriptors: 11Descriptor 1: OEM-specificData Format 1: Multiple-event handleDescriptor 2: OEM-specificData Format 2: Multiple-event handleDescriptor 3: Single-bit ECC memory errorData Format 3: POST results bitmapDescriptor 4: Multi-bit ECC memory errorData Format 4: POST results bitmapDescriptor 5: Parity memory errorData Format 5: Multiple-eventDescriptor 6: I/O channel blockData Format 6: Multiple-eventDescriptor 7: POST errorData Format 7: POST results bitmapDescriptor 8: PCI parity errorData Format 8: Multiple-event handleDescriptor 9: PCI system errorData Format 9: Multiple-event handleDescriptor 10: System limit exceededData Format 10: Multiple-event system managementDescriptor 11: OEM-specificData Format 11: POST results bitmap//物理内存阵列
Physical Memory ArrayLocation: System Board Or MotherboardUse: System MemoryError Correction Type: Multi-bit ECCMaximum Capacity: 96 GBNumber Of Devices: 12//内存阵列映射地址
Memory Array Mapped AddressStarting Address: 0x00000000000Ending Address: 0x000C00003FFRange Size: 3 GBPartition Width: 1//内存设备
Memory DeviceTotal Width: 72 bitsData Width: 79 bitsSize: 16384 MBForm Factor: DIMMSet: NoneLocator: DIMM_A1Bank Locator: BANK0Type: DDR3Type Detail: NoneSpeed: 1333 MHzManufacturer: Manufacturer00Serial Number: D8CC0900Asset Tag: AssetTagNum0Part Number: TS2GKR72V3H //内存设备映射地址
Memory Device Mapped AddressStarting Address: 0x00000000000Ending Address: 0x000000003FFRange Size: 1 kBPartition Row Position: 1Interleave Position: UnknownInterleaved Data Depth: 2//系统引导
System Boot InformationStatus: No errors detectedIPMI Device InformationInterface Type: KCS (Keyboard Control Style)Specification Version: 2.0I2C Slave Address: 0x10NV Storage Device Address: 10Base Address: 0x0000000000000CA2 (I/O)Register Spacing: Successive Byte Boundaries
Linux dmidecode命令的使用相关推荐
- linux dmidecode命令,Linux使用dmidecode命令查看内存型号
其实Linux的内存型号不难查看,下面,让小编带你们一起了解怎么查看Linux的内存型号吧. Linux使用dmidecode命令查看内存型号: 目前我的电脑内存只有512M,想加根内存条.机器主板是 ...
- linux dmidecode命令,linux下dmidecode命令获取硬件信息
dmidecode在 Linux 系统下获取有关硬件方面的信息.dmidecode 遵循 SMBIOS/DMI 标准,以一种可读的方式dump出机器的DMI(Desktop Management In ...
- php执行dmidecode,Linux dmidecode 命令
[root@localhost ~]$ dmidecode -q//BIOS相关的硬件信息 BIOS Information Vendor: Bochs Version: Bochs Release ...
- Linux下获取详细硬件信息的工具:Dmidecode命令详解
Dmidecode 这款软件允许你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准,其输出的信息包括 BIOS.系统.主板.处理器.内存.缓存等等.偶 ...
- 汇总 Linux下获取详细硬件信息的工具:Dmidecode命令详解
Dmidecode 这款软件允许你在 Linux 系统下获取有关硬件方面的信息.Dmidecode 遵循 SMBIOS/DMI 标准,其输出的信息包括 BIOS.系统.主板.处理器.内存.缓存等等.偶 ...
- Linux查看BIOS信息:dmidecode命令以及SMBIOS、DMI等
做Linux系统底层的测试,有时候需要关注BIOS的信息(包括基本信息.检测到的CPU和内存等).除了在开机启动时进入到BIOS之外,还可以在Linux系统中直接查看BIOS的信息,一般可以使用dmi ...
- Linux命令之dmidecode命令
一.dmidecode命令简介 dmidecode命令 可以让你在Linux系统下获取有关硬件方面的信息.dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示.由于DMI信息 ...
- linux常用命令(转载)
Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错.我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短 ...
- 如何使用dmidecode命令查看硬件信息
引言 当我们需要获取机器硬件信息时,可使用linux系统自带的dmidecode工具进行查询. dmidecode命令通过读取系统DMI表,显示服务器硬件和BIOS信息.除了可使用dmidecode查 ...
最新文章
- 基于python的界面自动化测试-基于Python语言的自动化测试实战第二章(上)
- 解决T400死机的问题!
- 标准评分卡分数计算原理_评分卡的形式、刻度及应用场景
- java smp_什么是SMP系统
- 编码器z相 C语言代码,编码器的Z相是什么?
- 适配器模式之门面模式
- 服务器Java环境配置
- python下载网易云音乐付费歌曲有哪些_Python3批量下载网易云音乐热歌榜
- wincc7.4安装记录
- 栅栏密码及其变形W型栅栏密码
- 偏见:人工智能辅助决策的隐患
- AT89S52单片机思维导图
- php论坛搭建,PHP建设论坛:Discuz!论坛快速架设指南
- PHP单元测试框架 - PHPUnit介绍
- UE4 虚幻 常用的流程控制蓝图节点介绍
- 辨别DVI接口连接线三种类型五种规格
- 新浪云sae springboot项目部署
- 【DB笔试面试733】在Oracle中,RAC中REMOTE_LISTENER的作用是什么?
- java pdf to word_java pdf转word 高效不失真
- dav格式视频 linux,Linux通过安装davfs2来挂载webdav网盘