| CPC G06F 3/064 (2013.01) [G06F 3/0614 (2013.01); G06F 3/0676 (2013.01); G11B 5/012 (2013.01); G11B 20/10388 (2013.01); G11B 2005/0021 (2013.01)] | 15 Claims |

|
1. A magnetic disk device comprising:
a plurality of magnetic disks, at least one of the plurality of magnetic disks including a first recording surface including a plurality of blocks to which logical block addresses are allocated and at least one of the plurality of magnetic disks including a second recording surface including a plurality of blocks to which logical block addresses are allocated;
a first magnetic head that writes data to the first recording surface;
a second magnetic head that writes data to the second recording surface; and
a controller that includes a counter configured to detect the number of writes of each of the first magnetic head and the second magnetic head, an unwritten detection unit configured to detect an unwritten block from the blocks, and a memory configured to store a first threshold for the number of writes of each of the first magnetic head and the second magnetic head and a second threshold less than or equal to the first threshold,
the controller performing control to
determine whether or not the number of writes of the first magnetic head configured to write data to a first block exceeds the first threshold when a command to write data to the first block of the first recording surface among the blocks is received,
write data to the first block by the first magnetic head in a case where the number of writes of the first magnetic head does not exceed the first threshold,
determine whether or not the number of writes of the second magnetic head exceeds the second threshold in a case where the number of writes of the first magnetic head exceeds the first threshold,
write data to the first block by the first magnetic head in a case where the number of writes of the second magnetic head exceeds the second threshold,
determine whether or not there is an unwritten second block on the second recording surface in a case where the number of writes of the second magnetic head does not exceed the second threshold,
write data to the first block by the first magnetic head in a case where there is no second block, and
exchange a logical block address allocated to the first block and a logical block address allocated to the second block, and write data to the second block by the second magnetic head in a case where there is the second block.
|