CPUやストレージの温度を調べる方法(CPU HDD SSD NVMe)

CPUの温度を調べる方法
HDD/SSDの温度を調べる方法(SATA)
NVMeのSSDの温度を調べる方法

[参考記事] ストレージの型番やシリアルを確認する方法(HDD SSD NVMe)
[参考記事] 各ストレージの速度一覧 規格速度や実効速度(HDD/SSD/M2/NVMe/USBメモリ)

CPUの温度を調べる方法

lm_sensorsパッケージ内のsensorsコマンドを使います。

lm_sensorsのインストール

CentOS / RedHat系

# yum -y install lm_sensors

Ubuntu / Raspberry Pi OS系

$ sudo apt install lm-sensors

実行例

$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +119.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +37.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +37.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +36.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +36.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +36.0°C  (high = +100.0°C, crit = +100.0°C)

HDD/SSDの温度を調べる方法(SATA)

hddtempコマンドを使います。
デバイス名が/dev/sdaのようにあらわされるストレージの温度を調べることができます。
M.2接続でもNVMe(PCIe)ではないSATAのものも調べられます。

hddtempはepelリポジトリにあるので、epelを先にインストールします。

yum install epel-release

hddtempのインストール

CentOS / RedHat系

yum install hddtemp

Ubuntu / Raspberry Pi OS系

sudo apt install hddtemp

実行例

$ hddtemp
/dev/sda: SanDisk SDSSDH3 2T00: 34°C

NVMeのSSDの温度を調べる方法

smartmontoolsパッケージ内のsmartctlコマンドを使います。

デバイス名が/dev/nvme0のようにあらわされるストレージだけでなく/dev/sdaなどの温度を調べることができます。
あくまでストレージデバイスに組み込まれているSMART機能を読み込むため/dev/md0のようなRAIDは調べることができません。
USB接続のHDDなどでは、変換するチップにSMARTを読み取る機能がないと調べられません。

smartctlはハードディスクの自己診断機能であるSelf-Monitoring, Analysis and Reporting Technology 略してS.M.A.R.T.を表示するコマンドです。

smartmontoolsのインストール

CentOS / RedHat系

# yum -y install smartmontools

Ubuntu / Raspberry Pi OS系

$ sudo apt install smartmontools

smartctlコマンドでは、ストレージのすべての情報が表示されるためgrepで絞り込みます。
またこのコマンドはroot権限が必要です。

# smartctl -a /dev/nvme0 | grep Temperature
Temperature:                        41 Celsius

grepで絞り込まずに実行すると、ストレージの型番や電源投入回数、稼働時間など様々な情報が表示されます。
また表示される情報やフォーマットはメーカーや型番により違います。

# smartctl -a /dev/nvme0
smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-240.15.1.el8_3.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       WDS100T1X0E-00AFY0
Serial Number:                      2101XXXXXXXX
Firmware Version:                   611100WD
PCI Vendor/Subsystem ID:            0x15b7
IEEE OUI Identifier:                0x001b44
Total NVM Capacity:                 1,000,204,886,016 [1.00 TB]
Unallocated NVM Capacity:           0
Controller ID:                      8224
Number of Namespaces:               1
Namespace 1 Size/Capacity:          1,000,204,886,016 [1.00 TB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            001b44 8b4892031a
Local Time is:                      Thu Apr  1 16:16:05 2021 JST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Maximum Data Transfer Size:         128 Pages
Warning  Comp. Temp. Threshold:     84 Celsius
Critical Comp. Temp. Threshold:     88 Celsius
Namespace 1 Features (0x02):        NA_Fields

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     9.00W    9.00W       -    0  0  0  0        0       0
 1 +     4.10W    4.10W       -    0  0  0  0        0       0
 2 +     3.50W    3.50W       -    0  0  0  0        0       0
 3 -   0.0250W       -        -    3  3  3  3     5000   10000
 4 -   0.0050W       -        -    4  4  4  4     5000   45000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         2
 1 -    4096       0         1

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        44 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    23,071 [11.8 GB]
Data Units Written:                 133,400 [68.3 GB]
Host Read Commands:                 364,680
Host Write Commands:                806,028
Controller Busy Time:               2
Power Cycles:                       55
Power On Hours:                     81
Unsafe Shutdowns:                   44
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

Error Information (NVMe Log 0x01, max 256 entries)
No Errors Logged

関連記事

スポンサーリンク

他のページを参考にする ソースを見る

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る