hard drive - What is the fastest way to force hdd to reallocate bad sectors and discard the data?

07
2014-07
  • BeowulfNode42

    I either own or am in charge of (at work) a lot of HDDs that are either part of raid arrays, or there are backups of the data elsewhere.

    When a disk is starting to fail and going slow because it's repeatedly trying to recover data out of an area is very annoying. I don't need the data and I'd like to either fix or force some errors on the failing drives so that hdd manufacturers are more likely replace them under warranty.

    I realise there are other QAs about bad sectors but they are typically talking about recovering data. I'm not interested in what data is on the drive. Essentially I'd like to rapidly force the SMART reallocated sector count up over the failure threshold as quickly as possible or have the disk stabilise with all bad sectors reallocated and no more occurring. Currently the steps I take are

    1. quick format the drive
    2. if there was any errors go to step 1
    3. use a powershell script to copy files to fill the entire disk
    4. if there were any errors delete the problem files and goto step 3
    5. verify contents of all files are the same as the source file
    6. if there were any errors go to step 1

    Usually the disk stops working completely or I become fed up with how many days this takes before the reallocated sector count reaches its failure threshold.

    Sometimes I try the technique of leaving a file in a special bad files folder I make that I know has a bad sector in the file as my own marker to not use those sectors.

    Are there any other tools or methods that could be faster?

    Edit: I should also point out that I'm not concerned about securely wiping the drive either. If someone physically obtains the disk and can read any data off it good for them.

  • Answers
  • cybernard

    You will need to find an older computer you can hide in a corner to let these programs run. If the drive is lightly damaged it can finish in <2 hours depending on the size of the hard drive.

    If you set dban (dariks boot and nuke) to 2 or 3 passes it might be faster. Maybe mhdd (with remap turned ON)

    Depending on the size of the hard drive, it does not like multi-TB hard drives. Spinrite from grc.com.

    All 3 methods are set and forget. Check it a couple times a day to see if they are done.

  • LogicDaemon

    Tools I use with similar purpose:

    1. HDAT2
    2. MHDD (look for "MHDD" in the list), also see FAQ Q: How can I fix delays on my HDD (red and brown blocks in MHDD)?
    3. HDDScan

    1 and 2 are both low-level DOS utilities, work on drive level, ignore filesystem, and can use custom timeouts (like "if there is 300 ms delay, rewrite the sector"). Most of the time the process is following (it's automatic): read data until there is a BAD or delay, rewrite bad/delayed sectors, continue. During rewrite, HDD either fixes the sector, or remaps it to reserve area. But as you don't need the data, you may choose to just erase the HDD. It will be slightly faster. Both utilities support repeat after end, so if drive slowly dies and throws more and more BADs, you'll be able to automatically finish drive' agony.

    HDDScan is Windows utility, it's from same author as MHDD, but it has limited functionality comparing to MHDD.


  • Related Question

    hard drive - Reallocated bad sectors cause my HDD to slow down?
  • Mantas

    I've just used several utilities to check whether my HDD drive is really failing - I've come to a conclusion that it's the hard disk drive that causes unusual slow downs as my system almost freezes sometimes (HDD light on my laptop is lit all the time when it happens).

    It appears that everything is healthy except for "reallocated bad sectors" being at 11. This is the only warning that disk check utilities give me. What does it mean? Is there anything I can do? My drive is running at DMA 5 mode, so that is not a problem.


  • Related Answers
  • Graham Perrin

    If (say) the sectors form part of the catalog B-tree of an HFS Plus file system on OS X, and if replacements are 'distant' from an optimally placed and otherwise contiguous B-tree, then it's possible that:

    • frequent reading across the distances is contributory to slowdowns.

    (On a hard disk drive without bad sectors, a contiguous catalog B-tree can have a significant positive effect on performance.)

    Defocusing from HFS Plus: comments under the question are valuable. So back up regularly, and consider replacing the drive – before troubles worsen.

    Understand that in an edge case, reallocation may cause dataloss …

    Suggested reading

    The SpinRite (version 5) documentation linked from under an answer (to a Mac-oriented question).

  • rob

    Yes, reallocated sectors can cause performance degradation. Consider a sequential read or write operation. If the operation encounters a reallocated sector, the operation is effectively no longer sequential because the read/write head must be repositioned to read the replacement sector (since the original sector was marked bad and the address was reallocated to a spare or "replacement" sector). If frequently-accessed files or filesystem structures are stored in the reallocated sector, then the performance degradation will be even more noticeable.

    It appears that everything is healthy except for "reallocated bad sectors" being at 11. This is the only warning that disk check utilities give me. What does it mean? Is there anything I can do?

    All the major hard disk manufacturers consider even one reallocated sector reported by the SMART diagnostics to be a serious enough flaw that they will replace your disk under warranty, even if the drive had reallocated sectors straight out of the box. Regardless of whether it's still under warranty, you should consider the drive a ticking time-bomb. Back up your data and replace the drive immediately.