Hi Bruce,

I found some errors on one of my SATA disks. I followed the instructions you gave at:

http://smartmontools.sourceforge.net/BadBlockHowTo.txt

but apparently could not fix the problems. Could you please help finding the solution for fixing the errors?

I think the problem arises when the power was suddenly off when I was copying data to the disk. Then I heard some noises when accessing the disk.

Then I found your HowTo and here is what I did:

1)
smartctl -t long /dev/hdd

2)
smartctl -l selftest /dev/hdd
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed: read failure       90%        41         1110970892
# 2  Extended offline    Completed: read failure       90%        33         1110969510

3)
smartctl -A /dev/hdd
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== 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   096   094   006    Pre-fail  Always       -       9691557
  3 Spin_Up_Time            0x0003   097   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       3
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       462
  7 Seek_Error_Rate         0x000f   100   253   030    Pre-fail  Always       -       33792802952799
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       48
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       18
184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   096   096   000    Old_age   Always       -       4
188 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   074   073   045    Old_age   Always       -       26 (Lifetime Min/Max 24/26)
194 Temperature_Celsius     0x0022   026   040   000    Old_age   Always       -       26 (0 18 0 0)
195 Hardware_ECC_Recovered  0x001a   036   031   000    Old_age   Always       -       9691557
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       355
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       355
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

4)
fdisk -lu /dev/hdd

Disk /dev/hdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1              63  1953520064   976760001   83  Linux


  b = (int)((L-S)*512/B)
where:
b = File System block number
B = File system block size in bytes
L = LBA of bad sector
S = Starting sector of partition as shown by fdisk -lu
and (int) denotes the integer part.

In our example, L=23421417, S=5269320, and B=4096.  Hence the
'problem' LBA is in block number
   b = (int)18152097*512/4096 = (int)2269012.125
so b=2269012.

5) I calculated the two b's as follows:

b=(1110969510 - 63) * 512 / 4096 = 138871180.875
b2=(1110970892 - 63) * 512 / 4096 = 138871353.625

138871353.625 - 138871180.875 = 172.75

6) Then I did the following (I reformated the disk, so there is nothing in the disk)
dd if=/dev/zero of=/dev/hdd1 bs=4096 count=355 seek=138871180
sync
dd if=/dev/zero of=/dev/hdd1 bs=4096 count=355 seek=138871353
sync

7) But still, I can see the Current_Pending_Sector to be 355 wven after I run \
smartctl -t offline /dev/hdd

The output of
smartctl -A /dev/hdd
is currently:

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== 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   096   094   006    Pre-fail  Always       -       9693701
  3 Spin_Up_Time            0x0003   097   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       3
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       462
  7 Seek_Error_Rate         0x000f   100   253   030    Pre-fail  Always       -       33956011710060
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       49
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       18
184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   096   096   000    Old_age   Always       -       4
188 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   075   073   045    Old_age   Always       -       25 (Lifetime Min/Max 24/26)
194 Temperature_Celsius     0x0022   025   040   000    Old_age   Always       -       25 (0 18 0 0)
195 Hardware_ECC_Recovered  0x001a   036   031   000    Old_age   Always       -       9693701
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       355
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       355
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

I don't know what I could do next. Your help is greatly appreciated!

Thanks so much!

Frank


Suspicious message? There’s an alert for that. Get your Hotmail® account now.