Patent ID: 8924775

Claim:
A data storage device, comprising: storage media comprising a plurality of sectors configured to store data; and a controller configured to selectively read and write data to the plurality of sectors, the controller being further configured to: tag a sector of the plurality of sectors as a bad sector to be relocated after a first failed read; untag the tagged sector after a successful write attempt to the sector after the first failed read, a successful write attempt being a write attempt, carried out after a prior failed read, in which data written to the tagged sector is successfully verified; after a second failed read from the sector subsequent to the successful write: tag the untagged sector as a bad sector to be relocated; adjust a recurring bad sector counter for the sector; and on a subsequent write request, consult a log detailing previous tagging and untagging of the plurality of sectors, and based at least in part on the consulted log, the bad sector counter and a threshold, determine whether to relocate data stored at a physical location on the data storage device corresponding to the sector to a spare location on the data storage device.