Patent ID: 7177979

Claim:
A method of preventing data loss in a magnetic disk device where a magnetic head writes data on concentric tracks on a surface of a magnetic disk, the tracks including a first plurality of first-parity-numbered tracks and a second plurality of second-parity-numbered tracks interleaved with the first plurality of first-parity-numbered tracks, the method comprising: maintaining a first set of one or more first-parity-track counters and a second set of second-parity-track counters regarding write operations on first-parity-numbered tracks and second-parity-numbered tracks; and in response to a command to write data to a given first-parity-numbered track, determining, based at least in part on values of counters in the first and second sets, whether a criterion is met; only if the criterion is met, reading data from a second-parity-numbered track; and updating a counter in the first set in a manner that in at least some instances depends on whether the criterion is met; if data is read from a second-parity-numbered track, determining a number of retries necessary for reading the data; and if the number of retries reaches a threshold, writing the data read from one or more second-parity-numbered tracks to one or more second-parity-numbered tracks.