众所周知,SSD的预定使用寿命有限。如何在Linux中检查SSD的当前健康状况?
大多数Google搜索结果会要求您在SMART信息中查找一个称为Media_Wearout_Indicator的百分比字段,或者诸如长期数据耐力之类的其他行话指标-不存在-是的,我确实检查了两个SSD,它们都缺少这些字段。我可以继续找到第三个SSD,但是我觉得这些领域不是标准化的。
为了演示这个问题,这里有两个例子。
对于第一个SSD,尚不清楚哪个字段指示损耗水平。但是,只有一个Unknown_Attribute的RAW值在1到100之间,因此我只能假设这就是我们要寻找的:
$ sudo smartctl -A /dev/sda
smartctl 6.2 2013-04-20 r3812 [x86_64-linux-3.11.0-14-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0002 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0002 100 100 000 Old_age Always - 6568
12 Power_Cycle_Count 0x0002 100 100 000 Old_age Always - 1555
171 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 0
172 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 0
173 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 57
174 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 296
187 Reported_Uncorrect 0x0002 100 100 000 Old_age Always - 0
230 Unknown_SSD_Attribute 0x0002 100 100 000 Old_age Always - 190
232 Available_Reservd_Space 0x0003 100 100 005 Pre-fail Always - 0
234 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 350
241 Total_LBAs_Written 0x0002 100 100 000 Old_age Always - 742687258
242 Total_LBAs_Read 0x0002 100 100 000 Old_age Always - 1240775277
因此,该SSD使用了其重写寿命的57%,对吗?
在另一个磁盘上,SSD_Life_Left属性引人注目,但对于看起来健康的SSD,除非其处于危险之中(我们将在几天后看到),否则其Raw值0(表明剩余寿命为0%)不太可能,并且如果显示“已经使用了0%的寿命”,则对于已磨损的硬盘(已磨损=已使用了一年以上)也不可能。
> sudo /usr/sbin/smartctl -A /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.11.6-4-desktop] (SUSE RPM)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 104 100 050 Pre-fail Always - 0/8415644
5 Retired_Block_Count 0x0033 100 100 003 Pre-fail Always - 0
9 Power_On_Hours_and_Msec 0x0032 100 100 000 Old_age Always - 4757h+02m+17.130s
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 1371
171 Program_Fail_Count 0x0032 000 000 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0
174 Unexpect_Power_Loss_Ct 0x0030 000 000 000 Old_age Offline - 52
177 Wear_Range_Delta 0x0000 000 000 000 Old_age Offline - 2
181 Program_Fail_Count 0x0032 000 000 000 Old_age Always - 0
182 Erase_Fail_Count 0x0032 000 000 000 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
194 Temperature_Celsius 0x0022 030 030 000 Old_age Always - 30 (Min/Max 30/30)
195 ECC_Uncorr_Error_Count 0x001c 104 100 000 Old_age Offline - 0/8415644
196 Reallocated_Event_Count 0x0033 100 100 000 Pre-fail Always - 0
231 SSD_Life_Left 0x0013 100 100 010 Pre-fail Always - 0
233 SandForce_Internal 0x0000 000 000 000 Old_age Offline - 3712
234 SandForce_Internal 0x0032 000 000 000 Old_age Always - 1152
241 Lifetime_Writes_GiB 0x0032 000 000 000 Old_age Always - 1152
242 Lifetime_Reads_GiB 0x0032 000 000 000 Old_age Always - 3072