While executing a command that accesses a sector on a disk-shaped
recording medium placed in a data recording device, an address of a
sector where it is difficult to read data is recorded in a memory. After
that, a determination is made as to whether or not the data recording
device is executing a command. If it is judged that the data recording
device is not executing a command, the address of the sector is read from
the memory, and then a bad sector is searched for by detecting whether or
not it is difficult to read data from each of surrounding sectors
adjacent to the sector, the address of which has been read.