在 https://github.com/smartmontools/smartmontools 可以看到一个硬盘检测工具。
项目的介绍是:
About Smartmontools
The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA/SATA, SCSI/SAS and NVMe disks. In many cases, these utilities will provide advanced warning of disk degradation and failure.
Smartmontools was originally derived from the Linux smartsuite package and supports ATA/SATA, SCSI/SAS, and NVMe disks and also SCSI/SAS tape devices. It should run on any modern Linux, FreeBSD, NetBSD, OpenBSD, Darwin (macOS), Solaris, Windows, Cygwin, OS/2, eComStation, or QNX system. Smartmontools can also be run from one of many different Live CDs/DVDs.
有支持 Windows 的版本,安装后进入安装的目录,使用如下命令即可检测输出当前硬盘的信息:
smartctl,exe -x /dev/sda
例如,在一台测试机上结果如下:
smartctl 7.5 2025-04-30 r5714 [x86_64-w64-mingw32-w11-24H2] (AppVeyor)
Copyright (C) 2002-25, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: SKHynix_HFS256GEJ4X112N
Serial Number: 4DBCQ48581010CG2R
Firmware Version: 51030C31
PCI Vendor/Subsystem ID: 0x1c5c
IEEE OUI Identifier: 0xace42e
Controller ID: 1
NVMe Version: 1.4
Number of Namespaces: 1
Namespace 1 Size/Capacity: 256,060,514,304 [256 GB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: ace42e 0026df381b
Local Time is: Sun Jul 20 22:46:46 2025 PDT
Firmware Updates (0x16): 3 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
Log Page Attributes (0x1e): Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg Pers_Ev_Lg
Maximum Data Transfer Size: 64 Pages
Warning Comp. Temp. Threshold: 86 Celsius
Critical Comp. Temp. Threshold: 87 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 4.5000W - - 0 0 0 0 100 100
1 + 3.0000W - - 1 1 1 1 200 200
2 + 0.6000W - - 2 2 2 2 400 400
3 - 0.0150W - - 3 3 3 3 2000 2000
4 - 0.0030W - - 4 4 4 4 5000 10000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 0
=== 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: 30 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 15%
Data Units Read: 117,427,832 [60.1 TB]
Data Units Written: 118,434,215 [60.6 TB]
Host Read Commands: 565,071,947
Host Write Commands: 434,694,135
Controller Busy Time: 8,007
Power Cycles: 5,554
Power On Hours: 1,648
Unsafe Shutdowns: 1,034
Media and Data Integrity Errors: 0
Error Information Log Entries: 21
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 35 Celsius
Temperature Sensor 2: 30 Celsius
Thermal Temp. 1 Transition Count: 249
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