A method of controlling a magnetic disk and a magnetic head, the magnetic disk being provided with a first track in which a plurality of first sectors in each of which a data segment is stored, and a second sector in which a parity for first error correction is stored are arranged in this order in a write and read direction from a first position, the magnetic head executing writing and reading on the first track in the write and read direction, the method comprising:
- executing a first operation of sequentially reading, from each of the plurality of first sectors, a first data segment stored therein as the data segment, and storing a group of the read first data segments in a buffer memory;
- obtaining a first parity from the group of the read first data segments;
- and
- executing a second operation of writing each first data segment in the group of the first data segments stored in the buffer memory, to a first sector that is a read source among the plurality of first sectors, and writing the first parity to the second sector, wherein
- a start timing of the second operation is before a timing when the magnetic head reaches the first position.