# 电脑健康检查

# 硬盘

  • 工具
sudo apt-get install smartmontools
  • 检查命令
sudo smartctl -a /dev/sdb1
  • 输出结果

# smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.8.0-52-generic] (local build)
# Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

# === START OF INFORMATION SECTION ===
# Model Family:     Toshiba 2.5" HDD MQ01ABF...
# Device Model:     TOSHIBA MQ01ABF050
# Serial Number:    76U7SKVUS
# LU WWN Device Id: 5 000039 72590be7a
# Firmware Version: AM0P2D
# User Capacity:    500,107,862,016 bytes [500 GB]
# Sector Sizes:     512 bytes logical, 4096 bytes physical
# Rotation Rate:    5400 rpm
# Form Factor:      2.5 inches
# Device is:        In smartctl database [for details use: -P show]
# ATA Version is:   ATA8-ACS (minor revision not indicated)
# SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
# Local Time is:    Sat Mar 22 16:45:47 2025 CST
# SMART support is: Available - device has SMART capability.
# SMART support is: Enabled

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

# General SMART Values:
# Offline data collection status:  (0x00)	Offline data collection activity
# 					was never started.
# 					Auto Offline Data Collection: Disabled.
# Self-test execution status:      (  20)	The self-test routine was aborted by
# 					the host.
# Total time to complete Offline 
# data collection: 		(  120) seconds.
# Offline data collection
# capabilities: 			 (0x5b) SMART execute Offline immediate.
# 					Auto Offline data collection on/off support.
# 					Suspend Offline collection upon new
# 					command.
# 					Offline surface scan supported.
# 					Self-test supported.
# 					No Conveyance Self-test supported.
# 					Selective Self-test supported.
# SMART capabilities:            (0x0003)	Saves SMART data before entering
# 					power-saving mode.
# 					Supports SMART auto save timer.
# Error logging capability:        (0x01)	Error logging supported.
# 					General Purpose Logging supported.
# Short self-test routine 
# recommended polling time: 	 (   2) minutes.
# Extended self-test routine
# recommended polling time: 	 ( 122) minutes.
# SCT capabilities: 	       (0x003d)	SCT Status supported.
# 					SCT Error Recovery Control supported.
# 					SCT Feature Control supported.
# 					SCT Data Table supported.

# SMART Attributes Data Structure revision number: 128
# Vendor Specific SMART Attributes with Thresholds:
# ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
#   1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
#   3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       913
#   5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
#   9 Power_On_Hours          0x0032   041   041   000    Old_age   Always       -       23910
#  12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1078
# 191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       127
# 192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       121
# 193 Load_Cycle_Count        0x0032   087   087   000    Old_age   Always       -       136011
# 194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       35 (Min/Max 2/52)
# 199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
# 240 Head_Flying_Hours       0x0032   083   083   000    Old_age   Always       -       6939
# 241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       12324240610
# 242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       16070706291
# 254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0

# SMART Error Log Version: 1
# No Errors Logged

# SMART Self-test log structure revision number 1
# Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# # 1  Short offline       Aborted by host               40%     14960         -
# # 2  Short offline       Completed without error       00%      1966         -
# # 3  Short offline       Completed without error       00%         0         -

# SMART Selective self-test log data structure revision number 1
#  SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
#     1        0        0  Not_testing
#     2        0        0  Not_testing
#     3        0        0  Not_testing
#     4        0        0  Not_testing
#     5        0        0  Not_testing
# Selective self-test flags (0x0):
#   After scanning selected spans, do NOT read-scan remainder of disk.
# If Selective self-test is pending on power-up, resume after 0 minute delay.

  • 解读
    • Raw_Read_Error_Rate: 即底层数据读取错误率,是存储器从一个硬盘表面读取数据时发生的错误率。这是硬盘健康状态的一个重要指标,反映了磁头从磁盘表面读取数据时出现的错误情况。这个数值是硬盘在运行时根据实测原始数据通过公式计算的结果,不同硬盘的计算公式和原始值可能有所不同。因此,直接比较不同硬盘的Raw_Read_Error_Rate数值可能没有太大意义,重要的是关注其变化趋势和与临界值的比较。正常范围:新硬盘刚开始使用时,Raw_Read_Error_Rate的当前值通常可以认为是预设的最大正常值(这个值因硬盘型号而异,可能是100、200或253等).临界值:硬盘厂商会指定一个表示硬盘可靠性的门限值,即临界值(或阈值)。如果Raw_Read_Error_Rate的当前值接近或超过这个临界值,就意味着硬盘可能变得不可靠,存在数据丢失或硬盘故障的风险。
    • Pre-fail: 即预失败或预先失效,通常指的是在设备或系统实际发生故障之前,已经表现出一些预示未来可能发生故障的迹象或信号。在硬盘健康监测方面,Pre-fail状态可能表示硬盘在数据传输或文件完整性校验过程中出现了checksum failure(校验和失败),这可能是由于数据传输错误、数据损坏或硬盘本身的物理问题导致的。在这种情况下,即使硬盘还没有完全失效,但已经出现了可能影响数据完整性和可靠性的迹象,因此被视为处于预失败状态。
    • Spin-Up Time(起转时间),指的是某个系统、设备或服务从初始启动到进入正常工作状态所需的时间。对于传统机械硬盘(HDD),Spin-Up Time通常为数秒到十几秒不等,具体时间取决于硬盘的型号和规格。而固态硬盘(SSD)则没有机械部件,因此其Spin-Up Time趋近于零。
    • Reallocated_Sector_Ct表示硬盘在存取过程中发现扇区有问题时,将坏扇区的数据重新映射到备用扇区的数量。这个过程是硬盘自我修复的一种机制,旨在保持数据的完整性和可访问性。
    • Power_On_Hours指的是设备自上次完全断电以来持续通电工作的时间总和。
    • Old_age: 表示硬盘因长时间使用而达到或接近其设计寿命的状态