Patent ID: 7525745

Claim:
A magnetic disk drive apparatus, comprising: a detector which detects shock applied to a main body of the magnetic disk drive; a magnetic disk which records data; a nonvolatile memory which serves as a cache memory when data is recorded in the magnetic disk; a threshold value setting unit which sets a threshold value of a storable size of the nonvolatile memory in accordance with count of the shock detected by the detector; addition unit which calculates a sum of a size of data which has been written in the nonvolatile memory and a size of data to be written in accordance with the write command, when a write command of data to the nonvolatile memory is input; determination section which determines whether or not the calculated data size is greater than the threshold value set by the threshold value setting unit; moving unit which moves the data written in the nonvolatile memory to the magnetic disk, when it is determined that calculated data size is greater than the threshold value; and writing section which writs the data based on the write command in the nonvolatile memory after the moving unit moves the data.