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

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

图片[1]-使用 smartmontools 查看你的 SSD 健康状态(macOS、Linux、Windows)-思安阁

macOS

打开终端执行:

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

结果示例:

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 AP0512N
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:

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

Ubuntu:

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

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

Windows

Powershell:

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

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

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

文章来源:作者:gc(at)sysin.org,主页:www.sysin.org

© 版权声明
THE END
喜欢就支持以下吧
点赞15
分享
评论 抢沙发

请登录后发表评论