A disk drive is disclosed comprising a disk having a plurality of tracks
each comprising a plurality of data sectors for storing a plurality of
data blocks. A microprocessor initializes a write verify counter in a
disk command data structure and executes a write command. The
microprocessor executes a write verify operation to verify the
recoverability of the data written to a plurality of target data sectors.
If the write verify operation fails for a target data sector, the
microprocessor updates the write verify counter in the disk command data
structure and re-executes the write command and the write verify
operation. If the write verify operation fails a number of times such
that the write verify counter exceeds a threshold, the microprocessor
relocates a data block from the failing target data sector to a spare
data sector.