1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Mac SSDの温度を見るコマンド

Last updated at Posted at 2025-11-10

1. 動機

USB4.0 接続の “ファン付き”SSDエンクロージャー を購入したので(さぞかし よく冷えるのだろうから)、SSDの温度をコマンドで見てみることにした

2. 準備

smartmontools をインストールします

Homebrew
brew install smartmontools

OR

MacPorts
port install smartmontools

3. SSDの情報を見る

sudo smartctl --all <デバイス>ですべての情報が見られます
中央下のTemperature温度です(⭐️印)

% sudo smartctl --all /dev/disk9s1
Password: <パスワード>
smartctl 7.5 2025-04-30 r5714 [Darwin 25.1.0 arm64] (local build)
Copyright (C) 2002-25, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       WD_BLACK SN850X 2000GB
Serial Number:                      999999999999
Firmware Version:                   620361WD
PCI Vendor/Subsystem ID:            0x15b7
IEEE OUI Identifier:                0x001b44
Total NVM Capacity:                 2,000,398,934,016 [2.00 TB]
Unallocated NVM Capacity:           0
Controller ID:                      8224
NVMe Version:                       1.4
Number of Namespaces:               1
Local Time is:                      Sat Nov  8 11:57:05 2025 JST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x00df):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp Verify
Log Page Attributes (0x1e):         Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg Pers_Ev_Lg
Maximum Data Transfer Size:         128 Pages
Warning  Comp. Temp. Threshold:     90 Celsius
Critical Comp. Temp. Threshold:     94 Celsius

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 +     6.00W    6.00W       -    0  0  0  0        0       0
 2 +     4.50W    4.50W       -    0  0  0  0        0       0
 3 -   0.0250W       -        -    3  3  3  3     5000   10000
 4 -   0.0050W       -        -    4  4  4  4     3900   45700

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

SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)
Critical Warning:                   0x00
Temperature:                        39 Celsius                   ⭐️
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    394,965 [202 GB]
Data Units Written:                 338,173 [173 GB]
Host Read Commands:                 5,132,572
Host Write Commands:                3,592,822
Controller Busy Time:               5
Power Cycles:                       59
Power On Hours:                     26
Unsafe Shutdowns:                   1
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, 16 of 256 entries)
No Errors Logged

Self-test Log (NVMe Log 0x06, NSID 0xffffffff)
Self-test status: No self-test in progress
No Self-tests Logged

4. 温度だけを表示する

温度だけ抽出して見やすく加工

smartctl -A <デバイス> | grep '^Temperature' | sed 's/Celsius/℃/' | xargs
% smartctl -A /dev/disk9s1 | grep '^Temperature' | sed 's/Celsius/℃/' | xargs
Temperature: 39 ℃

5. aliasしてコマンド化

(温度だけ表示)

alias ssdtemp='(){smartctl -A $1 | grep '^Temperature' | awk "{print(\$2, \"℃\")}"}'
使用例
% ssdtemp /dev/disk9s1
39 ℃


引数漏れのチェックを追加

alias ssdtemp='(){ if [ -z "$1" ];then echo Missing Device Name; else smartctl -A $1 | grep '^Temperature' | awk "{print(\$2, \"℃\")}"; fi }'
使用例
% ssdtemp
Missing Device Name

おまけ

1. 該当デバイスを確認する方法

diskutil listにて、調べたいSSDのデバイスを確認します

% diskutil list
(途中省略)
/dev/disk9 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1000.0 GB  disk9
                                 Physical Store disk6s2
   1:                APFS Volume WD-BLACK-1              94.1 GB    disk9s1

ボリューム名で探して、最右側のdiskXsY/dev/を付けた/dev/diskXsYがデバイス名となる

今回の場合は、ボリューム名WD-BLACK-1disk9s1のため、デバイス名は/dev/disk9s1

2. diskutil listからデバイス名とボリューム名だけを抽出するコマンド

(ボリューム名の昇順に一覧出力)

diskutil list | \
    cut -c34- | \
    awk '{ 
            if (NF>3 && $NF ~ /disk[0-9]+s[0-9]+/) { 
                printf "/dev/" $NF "\t"
                for(n=1;n<=NF-3;n++) { printf $(n) " " }
                printf "\n" 
            } 
        }' | \
    sort -k2

3. これをaliasしてコマンド化

alias disklist="diskutil list|cut -c34-|awk '{ if (NF>3 && \$NF ~ /disk[0-9]+s[0-9]+/) { printf \"/dev/\" \$NF \"\t\"; for(n=1;n<=NF-3;n++) { printf \$(n) \" \" }; printf \"\n\" } }'|sort -k2"
実行例
% disklist
/dev/disk3s1s1	com.apple.os.update-...
/dev/disk0s1	Container disk1
/dev/disk0s3	Container disk2
/dev/disk0s2	Container disk3
/dev/disk4s1	Container disk5
/dev/disk6s3	Container disk7
/dev/disk6s2	Container disk9
/dev/disk3s5	Data
/dev/disk6s1	EFI
/dev/disk5s1	iOS 26.1 Simulator
/dev/disk3s1	Macintosh HD
/dev/disk3s2	Preboot
/dev/disk3s3	Recovery
/dev/disk8s1	RTL9210B
/dev/disk3s6	VM
/dev/disk9s1	WD-BLACK-1
/dev/disk7s1	WD-BLACK-2

本当は物理ディスク単位なので、ディスクやコンテナのデバイス名でもよい

内蔵SSDの方が冷えている!?
% ssdtemp /dev/disk0
36 ℃
% ssdtemp /dev/disk9
39 ℃



以上

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?