使用 smartmontools 查看你的 SSD 健康状态(macOS、Linux、Windows)

Posted by sysin on 2021-03-10
Estimated Reading Time 3 Minutes
Words 659 In Total
更新日期:Wed Mar 10 2021 10:29:15 GMT+0800,阅读量:

请访问原文链接:使用 smartmontools 查看你的 SSD 健康状态(macOS、Linux、Windows),查看最新版。原创作品,转载请保留出处。

作者主页:sysin.org


无耻抄袭者 Yu Tao 请远离本站!!!

smartmontools 软件包包含两个实用程序(smartctl 和 smartd),用于使用内置于大多数现代 ATA/SATA、SCSI/SAS 和 NVMe 磁盘中的自我监控、分析和报告技术系统(SMART)来控制和监控存储系统。在许多情况下,这些实用程序将提供磁盘降级和故障的高级警告。Smartmontools 最初源于 Linux smartsuite 包 (sysin),实际上支持 ATA/SATA、SCSI/SAS 和 NVMe 磁盘以及 SCSI/SAS 磁带设备。它应该运行在任何现代的 Linux、FreeBSD、NetBSD、OpenBSD、Darwin(macOS)、Solaris、Windows、Cygwin、OS/2、eComStation 或 QNX 系统上。Smartmontools 也可以从许多不同的 Live CD/DVD 之上运行。

macOS

打开终端执行:

1
brew install smartmontools && smartctl --all /dev/disk0

结果示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
smartctl 7.2 2020-12-30 r5155 [Darwin 20.2.0 x86_64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number: APPLE SSD APSYSIN
Serial Number: C02988402ABCDEF1Q
Firmware Version: 1161.60.
PCI Vendor/Subsystem ID: 0x106b
IEEE OUI Identifier: 0x000000
Controller ID: 0
NVMe Version: <1.2
Number of Namespaces: 1
Local Time is: Wed Feb 24 08:46:29 2021 CST
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0004): Frmw_DL
Optional NVM Commands (0x0004): DS_Mngmt
Maximum Data Transfer Size: 256 Pages

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 0.00W - - 0 0 0 0 0 0

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

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 24 Celsius
Available Spare: 100%
Available Spare Threshold: 99%
Percentage Used: 0% #几乎没有什么损耗^_^
Data Units Read: 21,116,012 [10.8 TB]
Data Units Written: 17,778,070 [9.10 TB]
Host Read Commands: 415,746,270
Host Write Commands: 324,410,727
Controller Busy Time: 0
Power Cycles: 213
Power On Hours: 377
Unsafe Shutdowns: 33
Media and Data Integrity Errors: 0
Error Information Log Entries: 0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745

Linux

CentOS:

1
yum -y install smartmontools && smartctl --all /dev/nvme0n1  #/dev/* 具体名称请运行 sudo fdisk -l 查看

Ubuntu:

1
sudo apt install smartmontools && sudo smartctl --all /dev/nvme0n1   #/dev/* 具体名称请运行 sudo fdisk -l 查看

结果示例(暂无 Linux SSD ^_^):

Windows

Powershell:

1
2
3
4
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install smartmontools
Set-Location "C:\Program Files\smartmontools\bin"
.\smartctl.exe --all /dev/sda

结果示例(这是一台虚机,看不出来效果):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
smartctl 7.2 2020-12-30 r5155 [x86_64-w64-mingw32-2019] (sf-7.2-1)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor: Red Hat
Product: VirtIO
Revision: 0001
Compliance: SPC-2
User Capacity: 53,687,091,200 bytes [53.6 GB]
Logical block size: 512 bytes
Logical Unit id: 0x0000000000000004
Serial number:
Device type: disk
Local Time is: Wed Feb 24 10:02:52 2021
SMART support is: Unavailable - device lacks SMART capability.

=== START OF READ SMART DATA SECTION ===
Current Drive Temperature: 0 C
Drive Trip Temperature: 0 C

Error Counter logging not supported

Device does not support Self Test logging

捐助本站 ❤️ Donate

点击访问官方网站


文章用于推荐和分享优秀的软件产品及其相关技术,所有软件默认提供官方原版(免费版或试用版),免费分享。对于部分产品笔者加入了自己的理解和分析,方便学习和测试使用。任何内容若侵犯了您的版权,请联系作者删除。如果您喜欢这篇文章或者觉得它对您有所帮助,或者发现有不当之处,欢迎您发表评论,也欢迎您分享这个网站,或者赞赏一下作者,谢谢!

支付宝赞赏 微信赞赏

赞赏一下


☑️ 评论恢复,欢迎留言❗️
敬请注册!点击 “登录” - “用户注册”(已知不支持 21.cn/189.cn 邮箱)。请勿使用联合登录(已关闭)