如何使用 smartctl 在 Mac 上检查磁盘运行状况

如何使用 smartctl 在 Mac 上检查磁盘运行状况

有多种方法可以检查硬盘驱动器 (HDD) 和固态驱动器 (SSD) 的运行状况,这些硬盘驱动器在具有支持 SMART 的驱动器的 Mac 上使用,SMART 代表自我监控分析报告技术。这些选项的范围从使用“磁盘工具”检查驱动器的 SMART 状态相当简单,到使用 DriveDX 等第三方工具进行更复杂的选择。

This video cannot be played because of a technical error.(Error Code: 102006)

我们将为Mac用户介绍另一个出色的选择,以使用名为“smartctl”的命令行工具来监视和分析其存储设备的运行状况。

smartctl 实用程序将检查驱动器运行状况的 SMART 状态自我评估,提供内部驱动器的温度,并提供读取和写入信息(与 SSD 特别相关)和一般驱动器运行状况分析。

如何使用 smartctl 检查 Mac 驱动器运行状况

要开始使用 smartctl,您需要先使用 HomeBrew 安装它。是的,这意味着如果您尚未安装 Homebrew,则需要安装 Homebrew(以下是 macOS Sonoma、Ventura 及更高版本的说明)。

如果尚未开始,请打开终端应用程序。

首先,安装 smartctl:
brew install smartmontools

Homebrew 完成 smartctl 软件包的安装后,您就可以使用该实用程序来显示有关磁盘设备和驱动器运行状况的信息了:

smartctl -a disk0

(如果您有多个驱动器并想要检查这些驱动器,请将 disk0 替换为 disk1、disk2 等)

你将在命令行中收到一个报告,内容可能如下所示:

% sudo smartctl -a disk0
smartctl 7.4 2023-08-01 r5530 [Darwin 23.4.0 arm64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===

Model Number: APPLE SSD AP1024Z

Serial Number: 0ea8r31b280003

Firmware Version: 373.100.

PCI Vendor/Subsystem ID: 0x106b

IEEE OUI Identifier: 0x000000

Controller ID: 0

NVMe Version: 1.2

Number of Namespaces: 3

Local Time is: Wed Apr 10 01:11:24 2024 PDT

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: 41 Celsius

Available Spare: 100%

Available Spare Threshold: 99%

Percentage Used: 2%

Data Units Read: 471,985,722 [241 TB]

Data Units Written: 102,955,161 [52.7 TB]

Host Read Commands: 13,949,509,366

Host Write Commands: 1,322,749,058

Controller Busy Time: 0

Power Cycles: 255

Power On Hours: 1,514

Unsafe Shutdowns: 5

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

如您所见,smartctl 提供了许多有用且具有启发性的信息,包括温度、磁盘读/写信息、不安全的关机(崩溃或电源情况)、电源循环、驾驶时间等等。

在检查驱动器运行状况时,您特别需要注意的一个部分是“SMART 整体健康自我评估测试结果”部分,您需要说“通过”。如果显示“失败”,则需要立即备份数据,因为磁盘可能很快就会出现故障,这可能会导致灾难性的数据丢失。

正文完