Hard-Disk

我的硬碟是否有壞扇區?

  • February 23, 2014

我有一個新驅動器,我很困惑是否smartctl檢測到壞扇區。短自檢和擴展自檢completed without error。但Error Log表示Uncorrectable error in data96 sectors.

這是smartctl輸出:

smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-52-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Hitachi Deskstar T7K500
Device Model:     Hitachi HDT725025VLA380
Serial Number:    VFL104R73X993Z
LU WWN Device Id: 5 000cca 316f723ca
Firmware Version: V5DOA73A
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1
Local Time is:    Wed Feb  5 19:19:29 2014 UTC
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:  (0x80) Offline data collection activity
                   was never started.
                   Auto Offline Data Collection: Enabled.
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:        ( 4949) 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:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  83) minutes.
SCT capabilities:          (0x003f) SCT Status supported.
                   SCT Error Recovery Control supported.
                   SCT Feature Control supported.
                   SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
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   016    Pre-fail  Always       -       0
 2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
 3 Spin_Up_Time            0x0007   110   110   024    Pre-fail  Always       -       338 (Average 340)
 4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       1838
 5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
 7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
 8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0
 9 Power_On_Hours          0x0012   099   099   000    Old_age   Always       -       11746
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1822
192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       2103
193 Load_Cycle_Count        0x0012   099   099   000    Old_age   Always       -       2103
194 Temperature_Celsius     0x0002   162   162   000    Old_age   Always       -       37 (Min/Max 12/48)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0

SMART Error Log Version: 1
ATA Error Count: 27 (device log contains only the most recent five errors)
   CR = Command Register [HEX]
   FR = Features Register [HEX]
   SC = Sector Count Register [HEX]
   SN = Sector Number Register [HEX]
   CL = Cylinder Low Register [HEX]
   CH = Cylinder High Register [HEX]
   DH = Device/Head Register [HEX]
   DC = Device Command Register [HEX]
   ER = Error register [HEX]
   ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 27 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 03 80 c4 33 e7 40 00      02:28:22.700  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT
 ef 03 46 c4 33 e7 00 00      02:28:22.200  SET FEATURES [Set transfer mode]

Error 26 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 03 80 c4 33 e7 40 00      02:28:11.700  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT
 ef 03 46 c4 33 e7 00 00      02:28:11.200  SET FEATURES [Set transfer mode]

Error 25 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 03 80 c4 33 e7 40 00      02:28:00.700  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT
 ef 03 46 c4 33 e7 00 00      02:28:00.200  SET FEATURES [Set transfer mode]

Error 24 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 03 80 c4 33 e7 40 00      02:27:49.700  READ DMA EXT
 25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT
 25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT
 ef 03 46 c4 33 e7 00 00      02:27:49.200  SET FEATURES [Set transfer mode]

Error 23 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 03 80 c4 33 e7 40 00      02:27:38.900  READ DMA EXT
 25 03 08 7c a8 3a 40 00      02:27:38.900  READ DMA EXT
 35 03 08 7c a8 3a 40 00      02:27:38.900  WRITE DMA EXT
 25 03 08 7c a8 3a 40 00      02:27:38.900  READ DMA EXT
 25 03 08 a4 eb 94 40 00      02:27:38.900  READ DMA EXT

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     11746         -
# 2  Short offline       Completed without error       00%     11744         -

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.

這是一個截圖Error Log在此處輸入圖像描述

那麼發生了什麼?驅動器是否有壞扇區?


UPDATE1:

只是為了確保我也按照你如何badblocks使用壞塊中的建議使用了?.

一、非破壞性、1h長的只讀方式:

root@xubuntu:/home/xubuntu# badblocks -sv /dev/sda
Checking blocks 0 to 244198583
Checking for bad blocks (read-only test): done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

然後是破壞性的、長達 10 小時的寫入方法(小心使用!):

root@xubuntu:/home/xubuntu# badblocks -wsv /dev/sda
Checking for bad blocks in read-write mode
From block 0 to 244198583
Testing with pattern 0xaa: 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, 0 bad blocks found. (0/0/0 errors)

正如答案中所建議的那樣,這個硬碟驅動器上看起來確實沒有壞扇區。(耶!)

您的磁碟在從表面讀取數據時出現了一些問題,但似乎磁碟已處理了它。我有類似的情況:

Error 29 occurred at disk power-on lifetime: 18836 hours (784 days + 20 hours)
 When the command that caused the error occurred, the device was active or idle.

 After command completion occurred, registers were:
 ER ST SC SN CL CH DH
 -- -- -- -- -- -- --
 40 51 08 00 40 37 e6  Error: UNC 8 sectors at LBA = 0x06374000 = 104284160

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 c8 00 08 00 40 37 e6 08      03:39:32.447  READ DMA
 c8 00 08 f8 3f 37 e6 08      03:39:32.447  READ DMA
 c8 00 08 f0 3f 37 e6 08      03:39:32.447  READ DMA
 c8 00 08 e8 3f 37 e6 08      03:39:32.447  READ DMA
 c8 00 08 e0 3f 37 e6 08      03:39:32.447  READ DMA

當我想進行測試時,我得到了:

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 7  Short offline       Completed: read failure       90%     18845         104284160

最終,我設法解除了對扇區的阻塞,在執行擴展測試後,掃描整個表面,我得到了以下結果:

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 3  Extended offline    Completed without error       00%     18858         -

如果有壞塊,可以在下表中觀察到:

 5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0

在您的情況下,沒有跡象表明有壞扇區,因為在最後一個錯誤發生(11706 h)之後執行了擴展測試(11746 h)。這樣,你就可以安然入睡了。:)

正如我在評論中提到的,有兩種類型的壞塊。以下是有關兩者之間區別的簡簡訊息:

有兩種類型的壞扇區——通常分為“物理”和“邏輯”壞扇區或“硬”和“軟”壞扇區。

物理(或硬)壞扇區是硬碟驅動器上物理損壞的儲存集群。硬碟驅動器的磁頭可能接觸了硬碟驅動器的該部分並損壞了它,一些灰塵可能落在該扇區上並損壞了它,固態驅動器的快閃記憶體單元可能已經磨損,或者硬碟驅動器可能有其他導致扇區物理損壞的缺陷或磨損問題。這種類型的扇區無法修復。

邏輯(或軟)壞扇區是硬碟驅動器上似乎無法正常工作的儲存集群。作業系統可能試圖從該扇區讀取硬碟驅動器上的數據,發現糾錯碼 (ECC) 與該扇區的內容不匹配,這表明有問題。這些可能被標記為壞扇區,但可以通過用零覆蓋驅動器來修復 - 或者在過去,執行低級格式化。Windows 的磁碟檢查工具也可以修復此類壞扇區。

引用自:https://unix.stackexchange.com/questions/113737