Dmidecode
Linux에서 Dmidecode 명령으로 하드웨어 정보를 얻어보자.
1) dmidecode란?
dmidecode
는 Linux 시스템에서 하드웨어 정보를 가져오는 데 사용되는 명령줄 유틸리티이다.
시스템의 BIOS에서 하드웨어 정보를 읽어와서 표시한다. 다양한 하드웨어 구성 요소에 대한 정보를 표시할 수 있으며, 메인보드, BIOS, CPU, 메모리 등에 대한 세부 정보를 확인할 수 있다.
또한, dmidecode
명령을 사용하면 시스템 업그레이드를 진행해야할 때 즉각적으로 정보를 얻을 수 있고 이러함은 시스템의 섀시를 열지 않고 마더보드의 모델 시리얼같은 정보도 알 수 있고 BIOS에서 확인가능한 정보도 OS에서 확인할 수 있게 해준다.
2) 설치
대부분의 linux 배포판에서는 기본적으로 설치가 되어 있으며 만약 설치되어 있지 않은 경우 아래와 같이 설치한다.
# redhat 계열
$ yum install dmidecode*
# debian 계열
$ apt-get install dmidecode*
# suse 계열
$ zypper install dmidecode*
3) 테이블 구조 및 내용
dmidecode 명령은 서버 하드웨어, 바이오스 정보를 system DMI 테이블에서 읽어온다.
시스템의 현재 configuration 상태뿐만 아니라 최대 지원 가능한 설정 정보까지도 불러온다.
예를 들어, 시스템의 현재 RAM 정보와 최대 확장가능한 RAM 정보까지도 확인할 수 있다.
dmidecode의 output 형태는 다음과 같다.
Record Header : Handle {record id}, DMI type {dmi type id}, {record size} bytes
Record Value : {multi line record value}
Record ID : Unique identifier for every record in the DMI table
DMI type ID : Type of the record. i.e BIOS, Memory etc.,
Record Size : Size of the record in the DMI table.
Multi Line Record values : Multi line record value for that specific DMI type
4) 사용방법
옵션 없이 dmidecode 명령을 입력하면, 모든 정보가 나오므로, -t, -s 등의 옵션을 사용하여 원하는 정보를 확인하도록 한다.
-s, -t 옵션 뒤에는 아래와 같은 형식의 키워드와 Type ID(숫자)를 사용할 수 있으며, 기타 다른 옵션은 -h를 통해서 확인가능하다.
dmidecode -t [매개변수]
매개변수로 들어갈 수 있는 것은 bios, system, baseboard, chassis, processor, memory, cache,comector, slot이 있다.
-t 옵션과 매개변수로 출력되는 출력물들은 자세한 정보를 확인할 때는 좋지만 정확히 원하는 정보만을 출력할 때는 좋지 않다. (출력물이 긺)
이러한 경우 -s 옵션과 매개변수를 이용해준다,
demidecode -s
를 입력하면 -s 옵션의 어떤 매개변수를 입력할 수 있는지 확인할 수 있다.demidecode -t
를 입력하면 -s 옵션에 어떤 매개변수를 사용할 수 있는지 보여준 것 처럼 -t옵션에 사용가능한 매개변수들을 알려준다,
- DMI 테이블의 레코드 갯수 보기
DMI(Direct Media Interface) 테이블?
컴퓨터의 하드웨어 정보를 저장하고 제공하는 표준화된 방식.
SMBIOS(System Management BIOS)의 일부로, 시스템의 하드웨어 구성과 관련된 정보를 BIOS에 저장하는 방법을 정의한다.
recode count code
$ demidecode | grep ^Handel | wc -l
- DMI Type ID로 하드웨어 정보 확인
시스템의 CPU 정보를 보기 위해서 type id 4 옵션을 dmidecode 명령과 함께 준다.
$ dmidecode -t 4
5) Type 목록
Type Information
--------------------------------------------
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
6) 사용가능한 키워드type_id
를 사용하는 대신 dmidecode 명령에 '-t' 인수가 있는 키워드를 사용할 수 있다.
Keyword Types
------------------------------
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9
7) 활용하기
- 메모리 정보 얻기
16 Physical Memory Array$ dmidecode -t 16 # dmidecode 2.11 SMBIOS version fixup (2.31 -> 2.3). SMBIOS 2.3 present.
Handle 0x001D, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 4 GB // 이 시스템은 4GB RAM 지원
Error Information Handle: Not Provided
Number Of Devices: 4
메모리 관련 정보 ID는 5, 6, 16, 17
</br>
* BIOS 정보 얻기
```shell
$ dmidecode -t bios
# dmidecode 2.11
SMBIOS version fixup (2.31 -> 2.3).
SMBIOS 2.3 present.
Handle 0x0000, DMI type 0, 20 bytes
BIOS Information // BIOS 정보
Vendor: Phoenix Technologies LTD
Version: 6.00
Release Date: 12/06/2006
Address: 0xE78A0
Runtime Size: 100192 bytes
ROM Size: 64 kB
Characteristics:
ISA is supported
PCI is supported
PC Card (PCMCIA) is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
USB legacy is supported
Smart battery is supported
BIOS boot specification is supported
- 제조업체, 모델 및 일련번호 조회
$ dmidecode -t system # dmidecode 2.11 SMBIOS 2.4 present.
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: LENOVO
Product Name: 9637C76
Version: ThinkCentre M55e
Serial Number: L9BT188
UUID: 8015D37A-2F82-DC11-A3FB-8C6E4EBAD5CE
Wake-up Type: AC Power Restored
SKU Number: Not Specified
Family: Not Specified
Handle 0x000F, DMI type 12, 5 bytes
System Configuration Options
Option 1: Jumper settings can be described here.
Handle 0x0010, DMI type 15, 29 bytes
System Event Log
Area Length: 432 bytes
Header Start Offset: 0x0000
Header Length: 16 bytes
Data Start Offset: 0x0010
Access Method: General-purpose non-volatile data functions
Access Address: 0x0000
Status: Valid, Not Full
Change Token: 0x0000001A
Header Format: Type 1
Supported Log Type Descriptors: 3
Descriptor 1: POST error
Data Format 1: POST results bitmap
Descriptor 2: Single-bit ECC memory error
Data Format 2: Multiple-event
Descriptor 3: Multi-bit ECC memory error
Data Format 3: Multiple-event
Handle 0x0017, DMI type 23, 13 bytes
System Reset
Status: Enabled
Watchdog Timer: Present
Boot Option: Do Not Reboot
Boot Option On Limit: Do Not Reboot
Reset Count: Unknown
Reset Limit: Unknown
Timer Interval: Unknown
Timeout: Unknown
Handle 0x001F, DMI type 32, 20 bytes
System Boot Information
Status:
```
참고자료 :
https://ko.linux-console.net/?p=1501
https://blog.naver.com/hymne/220943578855