In this two-part article on “How to Deal with Bad Sectors on Your Hard Drive,” we have already looked at what bad sectors are and what causes them. We will now look at how your hard drive deals with them and what you can do to minimize the effect of bad sectors.
How Does Your Hard Drive Deal with Bad Sectors?
Some bad sectors are not permanent and can be fixed on the fly. For example, drive electronics use error detection and correction methods, such as Error Correction Code (ECC) and Partial-Response Maximum-Likelihood (PRML), to identify and repair bad sectors.
Other ways of recovering data from non-permanent bad sectors include:
- Reading the data multiple times
- Moving the read head slightly off-track
- Reinitializing the head
- Readjusting the servo systems
If the bad sector is more permanent and cannot be fixed on-the-fly, the drive typically adds the sector location to its list of sectors that are pending reallocation. The next time that the drive writes to this sector, it will write to the pending reallocation location and immediately read from it afterwards. And if the read is not successful, the sector will be reallocated to a spare sector on the drive. A permanent mapping within the drive’s reallocated sector table will be created between the old bad sector and its new spare sector location, so that any reads or writes to that bad sector will automatically be redirected to the spare sector in the future. The drive can only perform this sector reallocation process a finite number of times.
How Can You Minimize the Effect of Bad Sectors?
The best way to minimize the effect of bad sectors is to prevent them from happening in the first place:
- Avoid dropping, shaking, or bumping your hard drive.
- Avoid exposing your hard drive to extreme temperatures or humidity.
- Avoid plugging your hard drive directly into an outlet. Use a surge protector to protect your hard drive from power fluctuations.
But bad sectors can happen even if you use your drive under ideal operating conditions, so we further recommend that users:
- With RAID: Regularly perform a drive Self-Test with the SMART Complete Test option selected to identify bad sectors early on, followed by RAID scrubbing to reallocate any identified bad sectors.
- Without RAID: Regularly backup your important data regularly to an external device or a cloud service to minimize data loss in case of bad sectors.
Doing the above can go a long way towards keeping your data safe while your drives are functioning. But all drives will eventually fail, no matter what we do to keep them healthy during their lifetime. To anticipate your drives’ ultimate demise, we recommend using ULINK’s DA Drive Analyzer, which uses AI to predict drive failures.
Photo Credit: kynny