+ Post New Thread
Results 1 to 2 of 2

Thread: Fix HDD with uncorrectable sectors so they are isolated and i can read/write to HDD?

  1. #1
    Fli
    Fli is offline
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,550

    Fix HDD with uncorrectable sectors so they are isolated and i can read/write to HDD?



    Hello,

    usually when one see he cant read/write data to HDD, one can display SMART data for that HDD (Crystal Disk Info) and if there is pending sector count, one can right click drive, go to Properties/Tools and do filesystem check to cure pending sectors.

    Offline uncorrectable means problem with drive, if the count is above 200 one can experience data loss (canot read or write some sectors). If HDD is in warranty, return drive to the seller for replacement or contact local branch of the HDD vendor.

    How to fix drive so bad / offline uncorrectable sectors are isolated and not used for writing data?

    Here are some useful resources:

    http://hdrecover.sourceforge.net/ - Attempts to recover a hard disk that has bad blocks on it.
    http://www.dposoft.net/rbd.html - utility ... intended to isolate unrecoverable bad sectors from partitions.
    http://www.sj-vs.net/forcing-a-hard-disk-to-reallocate-bad-sectors/ - manually reallocate bad sectors

  2. #2
    Fli
    Fli is offline
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,550


    Is this useful / helpfull? Yes | No
    I have fixed one unbootable drive with several uncorrectable and pending sectors. The symptoms were:

    [ 582.378180] print_req_error: critical medium error, dev sdc, sector 261314564
    [ 582.378182] Buffer I/O error on dev sdc2, logical block 4, async page read
    [ 584.270037] sd 11:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    [ 584.270045] sd 11:0:0:0: [sdc] tag#0 Sense Key : Medium Error [current]
    [ 584.270048] sd 11:0:0:0: [sdc] tag#0 Add. Sense: Unrecovered read error
    [ 584.270052] sd 11:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 0f 93 58 04 00 00 01 00
    This is what i did on Linux (not have?, try live bootable USB Linux):

    - sdX is my faulty drive, replace by yours, see "lsblk" or "fdisk -l"
    - Do this on your risk and possibly backup by "ddrescue" or other SW if drive contains precious data not backed up elsewhere.


    $ sudo badblocks -vs /dev/sdX > 160GB_badblocks_bad_sectors
    $ cat 160GB_badblocks_bad_sectors
    83416588
    83416589
    83416590
    83416591
    130657280
    130657281
    130657282
    130657283
    $ smartctl -a /dev/sdX

    ...shown 2 pending sectors, 4 offline uncorectable...
    $ for block in $(cat 160GB_badblocks_bad_sectors);do sudo dd if=/dev/zero of=/dev/sdb bs=1024 count=1 seek=$block;done
    (bs=1024 is necessary since this is value used by badblocks)
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 4,59708 s, 0,2 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,0149379 s, 68,6 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,00450658 s, 227 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,00585185 s, 175 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,00143635 s, 713 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,000484465 s, 2,1 MB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,0451608 s, 22,7 kB/s
    1+0 vstoupivších záznamů
    1+0 vystoupivších záznamů
    1024 bajtů (1,0 kB, 1,0 KiB) zkopírováno, 0,00502066 s, 204 kB/s
    after that, "smartctl -a /dev/sdX" shows 0 pending sectors and 4 uncorrectable => like the writing succeeded and caused to mark 2 pending blocks as OK.

    I then did short drive test: sudo smartctl -t short /dev/sdX
    and after 2 minutes found in "sudo smartctl -a /dev/sdX" output that this test found no read errors unlike the test i have ran before writing to the sectors using "dd":
    Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
    # 1 Short offline Completed without error 00% 19684 -
    # 2 Extended offline Completed: read failure 90% 19684 166833180
    # 3 Short offline Completed: read failure 90% 19684 166833180
    full SMART:
    Code:
    ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
      1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       2449
      3 Spin_Up_Time            0x0027   137   133   021    Pre-fail  Always       -       4108
      4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1817
      5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
      9 Power_On_Hours          0x0032   074   074   000    Old_age   Always       -       19684
    10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
    11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
    12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1768
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       145
    193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       1671
    194 Temperature_Celsius     0x0022   105   095   000    Old_age   Always       -       38
    196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       4
    199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
    200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       4
    and the drive is booting OS without any apparent issue and dmesg command does not look like showing any related issue. Thank you for help solving this. Feedback welcome.

+ Post New Thread

Similar Threads

  1. What SEO blogs do you read?
    By MoulanaRafi in forum SEO - Search Engine Optimisation
    Replies: 1
    Last Post: 06-18-2018, 11:06 AM
  2. Replies: 0
    Last Post: 07-21-2017, 12:58 PM
  3. Any HDD bad sectors repair utility for MS Windows
    By Fli in forum Computers & Technology
    Replies: 1
    Last Post: 09-09-2015, 10:11 AM
  4. Replies: 0
    Last Post: 11-16-2014, 07:51 PM
  5. Read before exchange
    By Fli in forum Exchange Currencies
    Replies: 0
    Last Post: 03-23-2013, 05:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam