Patent ID: 7350017

Claim:
A magnetic disk unit, comprising: a magnetic disk as a recording medium; a controller which controls reading and writing data, having a first logical address, from and into the magnetic disk said controller rearranging data on the magnetic disk based on a second logical address to eliminate fragmentation thereof; an address translator section which translates between said first logical address used to specify predetermined data when reading and writing the data from and into the magnetic disk and the second logical address used to exchange the data with an external device, the second logical address being set in address space such that the data within a single file is continuous and wherein when a predetermined data is no longer used, the controller releases the second logical address associated with the data that is no longer used; and a cache memory of the data which holds data to be written to the magnetic disk or data read from the magnetic disk, wherein the controller classifies and manages data held in the cache memory as one of clean/full, clean/fragmented, dirty/full, and dirty/fragmented based on whether or not the data is saved in the magnetic disk, clean indicating that data has been saved and dirty indicating that data has not been saved, full indicating that all of the contents within a stride is composed of blocks of consecutive frame addresses and fragmented indicating that the contents of a stride is composed of blocks of nonconsecutive frame addresses and assignment of the second logical address to the data, and defragments the data recorded on the magnetic disk in accordance with the classification.