HDD Defect Management
HDD's employ sophisticated defect management techniques to prevent data loss and promote data integrity.
Earlier it was stated that there are many more sectors available in the drive beyond the drive advertised capacity. Typically each track has an additional sector beyond the required number of sectors and a drive may have thousands of spare sectors available. Those sectors are used in the event that a data sector becomes defective.
In the case of defective sectors, the data is recovered (if possible) and rewritten onto the spare sector. The new sector is now part of the drive sector map and no loss of capacity or data has occurred.
Data errors can be classified as soft errors and hard errors. Soft errors are recoverable. That is if the data was not read properly initially, the Error Recovery Procedures (ERP) of the drive can recover the data. ERP algorithms are very sophisticated and involve hardware correction (ECC on the fly - Error Correction Code), multiple reread of the data, track offset reading and application of firmware ECC. During the ERP process, the drive will determine if the sector requires reassignment to a spare sector.
If so, the spare sector is identified and the data moved to that sector.
If the data is unrecoverable it is a Hard error and the sector is no longer accessible. In this case data recovery and rebuild is done through the RAID subsystem.