注意:此问题之前已关闭,因为与主题无关。您可以阅读讨论。我在这里问这个问题的原因是:
- 该驱动器位于赞比亚农村学校的离线内容缓存服务器中。
- 服务器是由磁盘映像创建的,所有内容都是可替换的。
- 它必须便宜,因为赞比亚的学校预算有限,而且学校数量很多。
- 它还必须可靠,因为在糟糕的道路上更换它可能需要单程 8 小时。
- 我不被允许在这里询问哪些驱动器不是“超便宜的垃圾”。
- 因此,我们正在对符合这些标准的驱动器进行自己的研究和实验。
- 我无法通过覆盖(自动重新分配)来修复坏扇区,这违背了我的假设,我想知道原因。
- 我认为安全擦除也许可以修复坏扇区,但是在销毁驱动器之前我想听听其他人的意见。
- 我想我可能错过了 SMART 数据中可以预测故障的某些内容。
这是金士顿 240GB SSD 磁盘,在现场运行良好约 3 个月,突然出现坏扇区:
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.20-net6501-121115-1cw] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Device Model: KINGSTON SVP200S3240G
Serial Number: 50026B7228010E5C
LU WWN Device Id: 5 0026b7 228010e5c
Firmware Version: 502ABBF0
User Capacity: 240,057,409,536 bytes [240 GB]
Sector Size: 512 bytes logical/physical
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 8
ATA Standard is: ACS-2 revision 3
Local Time is: Tue Mar 5 17:10:24 2013 CAT
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: (0x02) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
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: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 48) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x0021) SCT Status supported.
SCT Data Table supported.
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 084 084 050 Pre-fail Always - 10965286670575
5 Reallocated_Sector_Ct 0x0033 100 100 003 Pre-fail Always - 16
9 Power_On_Hours 0x0032 000 000 000 Old_age Always - 46823733462185
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 127
171 Unknown_Attribute 0x0032 000 000 000 Old_age Always - 0
172 Unknown_Attribute 0x0032 000 000 000 Old_age Always - 0
174 Unknown_Attribute 0x0030 000 000 000 Old_age Offline - 131
177 Wear_Leveling_Count 0x0000 000 000 000 Old_age Offline - 1
181 Program_Fail_Cnt_Total 0x0032 000 000 000 Old_age Always - 0
182 Erase_Fail_Count_Total 0x0032 000 000 000 Old_age Always - 0
187 Reported_Uncorrect 0x0032 000 000 000 Old_age Always - 49900
194 Temperature_Celsius 0x0022 033 078 000 Old_age Always - 33 (Min/Max 21/78)
195 Hardware_ECC_Recovered 0x001c 120 120 000 Old_age Offline - 235163887
196 Reallocated_Event_Count 0x0033 100 100 003 Pre-fail Always - 16
201 Soft_Read_Error_Rate 0x001c 120 120 000 Old_age Offline - 235163887
204 Soft_ECC_Correction 0x001c 120 120 000 Old_age Offline - 235163887
230 Head_Amplitude 0x0013 100 100 000 Pre-fail Always - 100
231 Temperature_Celsius 0x0013 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0000 000 000 000 Old_age Offline - 363
234 Unknown_Attribute 0x0032 000 000 000 Old_age Always - 208
241 Total_LBAs_Written 0x0032 000 000 000 Old_age Always - 208
242 Total_LBAs_Read 0x0032 000 000 000 Old_age Always - 1001
SMART Error Log not supported
SMART Self-test Log not supported
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.
现在我在磁盘的某些位置出现了坏块:
root@iPad2:~# badblocks /dev/sda -v
Checking blocks 0 to 234431063
Checking for bad blocks (read-only test): 8394752 done, 1:15 elapsed
8394756 done, 1:21 elapsed
8394757 done, 1:23 elapsed
8394758 done, 1:24 elapsed
8394759 done, 1:27 elapsed
...
190882871one, 29:49 elapsed
190882888one, 29:53 elapsed
190882889one, 29:54 elapsed
190882890one, 29:56 elapsed
190882891one, 29:58 elapsed
done
Pass completed, 80 bad blocks found.
它们似乎是可重复的,并且自动重新分配失败,因此无法通过写入来修复它们:
root@iPad2:~# badblocks /dev/sda -wvf 8394756 8394756
/dev/sda is apparently in use by the system; badblocks forced anyway.
Checking for bad blocks in read-write mode
From block 8394756 to 8394756
Testing with pattern 0xaa: 8394756
done
Reading and comparing: done
Testing with pattern 0x55: done
Reading and comparing: done
Testing with pattern 0xff: done
Reading and comparing: done
Testing with pattern 0x00: done
Reading and comparing: done
Pass completed, 1 bad blocks found.
我在系统日志中收到如下错误:
ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
ata1.00: irq_stat 0x40000000
ata1.00: failed command: READ FPDMA QUEUED
ata1.00: cmd 60/08:00:08:30:00/00:00:01:00:00/40 tag 0 ncq 4096 in
res 51/40:08:08:30:00/00:00:01:00:00/40 Emask 0x409 (media error) <F>
ata1.00: status: { DRDY ERR }
ata1.00: error: { UNC }
ata1.00: configured for UDMA/133
sd 0:0:0:0: [sda] Unhandled sense code
sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
01 00 30 08
sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 01 00 30 08 00 00 08 00
end_request: I/O error, dev sda, sector 16789512
Buffer I/O error on device sda, logical block 2098689
ata1: EH complete
现在我不明白为什么这个磁盘上的自动重新分配会失败。smartctl
输出对我来说一切正常。只有 16 个扇区被重新分配,这根本不多。我看不出这个驱动器拒绝重新分配扇区的任何合理原因。这个型号的 SSD 是坏了还是设计不好?
笔记:
- 根据金士顿的文档,属性 174 是“意外断电”。
- 131 次意外断电情况相当糟糕。
- 属性 187 (Reported_Uncorrect) 为 49900,而最大可能值为 65535
- 史上最高气温高达 78 摄氏度
最多有趣的智能计数器被金士顿隐藏在此驱动器上。但我们可以从属性 196 Reallocated_Event_Count 推断出备用扇区的数量,该属性的归一化值公式如下:
100 -(100* RBC / MRC)
RBC = Retired Block Count (Grown)
MRE = Maximum reallocation count
由于标准化值为 100,这意味着 RBC << MRE,所以我们还远没有耗尽所有可用于重新分配的部门。
答案1
廉价 SSD 似乎存在严重的质量问题。您会发现很多用户对您的特定驱动器存在问题。但是我认为供应商也会以相同的标签销售不同的驱动器(例如,使用其他 NAND 芯片/控制器)。因此,每个驱动器的行为可能不同。
SMART 值没有表明驱动器很快就会发生故障。根据我的经验,情况是一样的:突然出现驱动器错误,然后磁盘发生故障。
您使用 SSD 的原因是什么?我看到 SSD 的优点是没有机械部件,防尘且发热量较低。但我也看到很多缺点。
例如,即使使用磨损均衡,在繁忙的卷上也可能很快达到对单个存储单元的写入次数,例如当您使用具有日志记录的文件系统时。
而且电子设备也会受到高湿度或高温的影响 - 与传统硬盘一样。
为什么不改用更便宜的传统硬盘(如果不需要 RAID)并向服务器提供备用硬盘,这些硬盘在需要更换之前不会连接(已安装在服务器机箱中或安装在热插拔笼中,以便磁盘可用于不同的服务器)。然后他们可以通过现场脚本或远程脚本(如果可能)做好准备。
只要传统硬盘没有通电,运输到目的地就会很艰难……
如果有多个学校服务器/永久客户端和可靠/冗余网络,分布式文件系统也许也可以帮助创建故障安全缓存服务器(例如通过使用 glusterfs)。