分享

UOS系统中dmidecode 获取CPU ID等系统硬件信息的方法?

lemon 2021-10-31 15:19:55 发表于 已解决 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 2459
在例如清华同方/联想/曙光的设备生产时会把sn号唯一识别码烧录到固件bios上,在uos系统上通过dmidecode可获取硬件信息

1、 dmidecode  -t  [类型代码或名称 ] 指令
(1)获取系统信息,例如:
  1. [root@zhaoyangyang Desktop]# dmidecode -t 1
  2. # dmidecode 2.12
  3. SMBIOS 2.4 present.

  4. Handle 0x0001, DMI type 1, 27 bytes
  5. System Information
  6.         Manufacturer: VMware, Inc.
  7.         Product Name: VMware Virtual Platform
  8.         Version: None
  9.         Serial Number: VMware-56 2d 6f cf 37 7b b6 ee-2b 86 0f 6b 26 e5 4f 37
  10.         UUID: 564D6FCF-C77B-B6EE-2B26-0F6B25E02F07
  11.         Wake-up Type: Power Switch
  12.         SKU Number: Not Specified
  13.         Family: Not Specified
复制代码
(2)获取主板信息:
  1. [root@zhaoyangyang Desktop]# dmidecode -t 2
  2. # dmidecode 2.12
  3. SMBIOS 2.4 present.

  4. Handle 0x0002, DMI type 2, 15 bytes
  5. Base Board Information
  6.         Manufacturer: Intel Corporation
  7.         Product Name: 440BX Desktop Reference Platform
  8.         Version: None
  9.         Serial Number: None
  10.         Asset Tag: Not Specified
  11.         Features: None
  12.         Location In Chassis: Not Specified
  13.         Chassis Handle: 0x0000
  14.         Type: Unknown
  15.         Contained Object Handles: 0
复制代码
(3)获取CPU ID
  1. dmidecode -t 4 | grep ID
复制代码
(4)获取系统序列号
  1. dmidecode  | grep  Serial
  2. 附:

  3. dmidecode -t 指令参数参考

  4.        Type   Information
  5.        ────────────────────────────────────────────
  6.           0   BIOS
  7.           1   System
  8.           2   Baseboard
  9.           3   Chassis
  10.           4   Processor
  11.           5   Memory Controller
  12.           6   Memory Module
  13.           7   Cache
  14.           8   Port Connector
  15.           9   System Slots
  16.          10   On Board Devices

  17.          11   OEM Strings
  18.          12   System Configuration Options
  19.          13   BIOS Language
  20.          14   Group Associations
  21.          15   System Event Log
  22.          16   Physical Memory Array
  23.          17   Memory Device
  24.          18   32-bit Memory Error
  25.          19   Memory Array Mapped Address
  26.          20   Memory Device Mapped Address
  27.          21   Built-in Pointing Device
  28.          22   Portable Battery
  29.          23   System Reset
  30.          24   Hardware Security
  31.          25   System Power Controls
  32.          26   Voltage Probe
  33.          27   Cooling Device
  34.          28   Temperature Probe
  35.          29   Electrical Current Probe
  36.          30   Out-of-band Remote Access
  37.          31   Boot Integrity Services
  38.          32   System Boot
  39.          33   64-bit Memory Error
  40.          34   Management Device
  41.          35   Management Device Component
  42.          36   Management Device Threshold Data
  43.          37   Memory Channel
  44.          38   IPMI Device
  45.          39   Power Supply
  46.          40   Additional Information
  47.          41   Onboard Devices Extended Information
  48.          42   Management Controller Host Interface
复制代码
2、dmidecode -s [关键字] 指令
例如,查看处理器生产厂家:
  1. [root@shanghai docker]# dmidecode -s processor-manufacturer
  2. GenuineIntel
  3. 附可查询的关键字:

  4. bios-vendor, bios-version, bios-release-date,  
  5. system-manufacturer,  system-product-name,   system-version, system-serial-number,  system-uuid,
  6. baseboard-manufacturer, baseboard-product-name, baseboard-version, baseboard-serial-number,  baseboard-asset-tag,
  7. chassis-manufacturer, chassis-type, chassis-version, chassis-serial-number, chassis-asset-tag,
  8. processor-family, processor-manufacturer, processor-version,  processor-frequency
复制代码


版权说明:论坛帖子主题均由合作第三方提供并上传,若内容存在侵权,请进行举报

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系在线客服