Blue Flower

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

下载仅供下载体验和测试学习,不得商用和正当使用。

下载体验

请输入密码查看内容!

如何获取密码?

 

点击下载