ハードウェアの情報を知る方法(CPU型名など)

シェアする

自作パソコンとして構築してから、かなりの年数がたっており、ハードウェア構成を忘れてしまっています。そんな時は、RHEL(Linux)であれば、OSから情報を読み取ることが可能です。

dmidecodeコマンドで参照

dmidecodeとは、コマンド名そのままに、DMI(SMBIOS)からの情報をdecodeするためのものです。SMBIOS(System Management BIOS)とは、ハードウェアの情報をBIOSに格納しているものです。

dmidecodeで参照できるタイプ一覧
# dmidecode --type
dmidecode: option '--type' requires an argument
Type number or keyword expected
Valid type keywords are:
  bios
  system
  baseboard
  chassis
  processor
  memory
  cache
  connector
  slot
 
ベースボードの情報
# dmidecode --type baseboard
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
        Manufacturer: Gigabyte Technology Co., Ltd.
        Product Name: GA-MA790GPT-UD3H
        Version: x.x
        Serial Number:
 
プロセッサーの情報
# dmidecode --type processor
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0004, DMI type 4, 35 bytes
Processor Information
        Socket Designation: Socket M2
        Type: Central Processor
        Family: Athlon
        Manufacturer: AMD
        ID: 52 0F 10 00 FF FB 8B 17
        Signature: Family 16, Model 5, Stepping 2
        Flags:
                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)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                HTT (Multi-threading)
        Version: AMD Athlon(tm) II X4 605e Processor
        Voltage: 1.1 V
        External Clock: 200 MHz
        Max Speed: 3000 MHz
        Current Speed: 2300 MHz
        Status: Populated, Enabled
        Upgrade: Socket 754
        L1 Cache Handle: 0x000A
        L2 Cache Handle: 0x000C
        L3 Cache Handle: Not Provided
        Serial Number:
        Asset Tag:
        Part Number:

メモリーの情報
# dmidecode --type memory
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.

Handle 0x0005, DMI type 5, 24 bytes
Memory Controller Information
        Error Detecting Method: 64-bit ECC
        Error Correcting Capabilities:
                None
        Supported Interleave: One-way Interleave
        Current Interleave: One-way Interleave
        Maximum Memory Module Size: 4096 MB
        Maximum Total Memory Size: 16384 MB
        Supported Speeds:
                70 ns
                60 ns
                50 ns
        Supported Memory Types:
                Standard
                DIMM
        Memory Module Voltage: 2.9 V
        Associated Memory Slots: 4
                0x0006
                0x0007
                0x0008
                0x0009
        Enabled Error Correcting Capabilities:
                None

Handle 0x0006, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: A0
        Bank Connections: 1
        Current Speed: 53 ns
        Type: Other Unknown EDO
        Installed Size: 4096 MB (Double-bank Connection)
        Enabled Size: 4096 MB (Double-bank Connection)
        Error Status: OK

Handle 0x0007, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: A1
        Bank Connections: 2
        Current Speed: 53 ns
        Type: Other Unknown EDO
        Installed Size: 4096 MB (Double-bank Connection)
        Enabled Size: 4096 MB (Double-bank Connection)
        Error Status: OK

Handle 0x0008, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: A2
        Bank Connections: 3
        Current Speed: 53 ns
        Type: Other Unknown EDO
        Installed Size: 4096 MB (Double-bank Connection)
        Enabled Size: 4096 MB (Double-bank Connection)
        Error Status: OK

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: A3
        Bank Connections: 4
        Current Speed: 53 ns
        Type: Other Unknown EDO
        Installed Size: 4096 MB (Double-bank Connection)
        Enabled Size: 4096 MB (Double-bank Connection)
        Error Status: OK

Handle 0x0027, DMI type 16, 15 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: None
        Maximum Capacity: 16 GB
        Error Information Handle: Not Provided
        Number Of Devices: 4

Handle 0x0028, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0027
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: A0
        Bank Locator: Bank0/1
        Type: Unknown
        Type Detail: None
        Speed: 1333 MHz
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

Handle 0x0029, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0027
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: A1
        Bank Locator: Bank2/3
        Type: Unknown
        Type Detail: None
        Speed: 1333 MHz
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

Handle 0x002A, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0027
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: A2
        Bank Locator: Bank4/5
        Type: Unknown
        Type Detail: None
        Speed: 1333 MHz
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

Handle 0x002B, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0027
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 4096 MB
        Form Factor: DIMM
        Set: None
        Locator: A3
        Bank Locator: Bank6/7
        Type: Unknown
        Type Detail: None
        Speed: 1333 MHz
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

/procからの参照

RHELでは、/procという特殊なディレクトリーを参照することで、システムの状況を知ることができます。

その情報の一部から、ハードウェアの情報を参照します。

プロセッサーの情報
$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 5
model name : AMD Athlon(tm) II X4 605e Processor
stepping : 2
microcode : 0x10000db
cpu MHz : 800.000
cache size : 512 KB
   : (省略)
ハードディスクの情報
$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: Hitachi HDS72101 Rev: A3EA
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: Hitachi HDS72101 Rev: A3EA
  Type:   Direct-Access                    ANSI  SCSI revision: 05
メモリーの情報
# cat /proc/meminfo
MemTotal:       15751244 kB
MemFree:          186384 kB
MemAvailable:    2034580 kB
Buffers:               0 kB
Cached:          2079256 kB
SwapCached:       207908 kB
Active:          9477796 kB
Inactive:        5632788 kB
Active(anon):    8252240 kB
Inactive(anon):  4813472 kB
Active(file):    1225556 kB
Inactive(file):   819316 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       8388604 kB
SwapFree:        7901556 kB
Dirty:                28 kB
Writeback:             0 kB
AnonPages:      12823564 kB
Mapped:            69868 kB
Shmem:             34384 kB
Slab:             168248 kB
SReclaimable:     112384 kB
SUnreclaim:        55864 kB
KernelStack:        6912 kB
PageTables:        50544 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    16264224 kB
Committed_AS:   19637168 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      354552 kB
VmallocChunk:   34358947836 kB
HardwareCorrupted:     0 kB
AnonHugePages:   9451520 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      158592 kB
DirectMap2M:     4558848 kB
DirectMap1G:    11534336 kB
その他

その他のコマンドで参照する方法です。

# free -h
              total        used        free      shared  buff/cache   available
Mem:            15G         12G        193M         33M        2.1G        1.9G
Swap:          8.0G        476M        7.5G
# smartctl -i /dev/sda
smartctl 6.2 2017-02-27 r4394 [x86_64-linux-3.10.0-693.21.1.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Hitachi Deskstar 7K1000.C
Device Model:     Hitachi HDS721010CLA332
Serial Number:    JP2940HQ3RU09H
LU WWN Device Id: 5 000cca 35df4a48f
Firmware Version: JP4OA3EA
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Sun Sep  9 10:26:48 2018 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled