The present invention relates to computer hardware and data storage in particular. Hard Disk Drives are ubiquitous within computer systems, as they provide low cost, voluminous data storage that can be accessed quickly in any order (termed random access). Data are stored on a magnetic disk by a write head that induces a magnetic field that creates a particular localized magnetic polarization on the magnetic surface of the rotating disk in one of two directions. One direction is defined as a logical ‘0’, and the other a logical ‘1’. The disk rotates at a fixed speed and the read/write head assembly is mounted on an arm that is actuated such that it can move radially or semi-radially across the disk as it rotates. To read the stored data, the read head senses the instantaneous polarization of the magnetic field of the magnetic disk at the locations previously written. Hard Disk Drives (HDDs) routinely have bad sectors due to manufacturing media defects, as it would be prohibitively expensive to produce disk drives with no defects.
As further depicted in
In operation, if sector 204 is found during manufacturing or in subsequent use to be defective, it may be marked bad by the HDD 100 within its defect table, and sector 206, as an alternate sector, may be defined within the defect table as the alternate location to store data intended for sector 204. This allows the HDD 100 to manage bad sectors without involvement from the computer operating system or file system. Because sector 204 and sector 206 are on different tracks, the read/write head 222 must be moved from track 230 to track 220 in order to access sector 206. This creates a significant but necessary performance penalty for the use alternate sectors on the disk 200. Because the disk drive must move the head assembly to the alternate sector location, wait for the sector to rotate under the read/write head, read or write the data, and then seek back to the original track to continue the transaction, and then wait for the next sector to rotate back under the read/write head assembly, it causes a significant delay in the sequential read or write operation, often a penalty of many milliseconds.
There is a need, therefore, for a way to replace bad sectors on a hard disk drive without the penalty of an increase in access times.
The present invention is directed to a method of replacing bad sectors in a hard disk drive utilizing a Magnetoresistive Random Access Memory (MRAM) device as a dedicated spare to replace bad sectors causing no decrease in total storage capacity of the disk. MRAM is a non-volatile technology, which retains information when power is removed. The technology is preferred over Flash technology due to the limited number of write/erase cycles inherent in Flash technology as well as the need to perform read/modify writes to Flash, whereas MRAM technology can be randomly written and read an unlimited number of times.
MRAM technology uses magnetic charge to store data instead of an electrical charge and is advantageous in that it is highly scalable, does not degrade over time due to the number of times it is written (like flash technologies do), has relatively low power requirements, is highly reliable, and cost-effective. Write cycle speeds are in the neighborhood of 35 nanoseconds. Unlike conventional RAM solid-state chip technologies, in MRAM, data is stored by magnetic storage elements. The elements are formed from two ferromagnetic plates, each of which can hold a magnetic field, separated by a thin insulating layer. One of the two plates is a permanent magnet set to a particular polarity, the other's field will change to match that of an external field. A memory device is built from a grid of such “cells”. Reading is accomplished by measuring the electrical resistance of the cell.
A particular cell is (typically) selected by powering an associated transistor which switches current from a supply line through the cell to ground. Due to the magnetic tunnel effect, the electrical resistance of the cell changes due to the orientation of the fields in the two plates. By measuring the resulting current, the resistance inside any particular cell can be determined, and from this the polarity of the writable plate. Typically, if the two plates have the same polarity this is considered to mean “0”, whereas if the two plates are of opposite polarity the resistance will be higher and this means “1”. Data is written to the cells using a variety of means. In the simplest, each cell lies between a pair of write lines arranged at right angles to each other, above and below the cell. When current is passed through them, an induced magnetic field is created at the junction, which the writable plate picks up.
In one embodiment of the invention, a method of replacing bad sectors in an HDD comprises detecting bad sectors on the hard disk drive; remapping the bad sectors to an auxiliary data storage device comprising an MRAM connected to the processor within the hard disk drive; and storing data on the auxiliary storage device. An added side benefit is the elimination of the reserved alternate sectors on the disk media, freeing space for general usage.
As depicted therein, the remapping process begins with step 502 and flows to 504 where it checks for any Read commands from the host device interface 116. If a Read command has not been received (no), the process returns to check again at step 504. If a Read command is received (yes) the process moves to step 506, where the process checks whether the first LBA to be read has been mapped to an alternate location in MRAM 300. If the sector has not been remapped to MRAM 300 (no), the process flows to step 514, where the LBA data are read from the disk 320. The process continues at step 512, where it checks if the read was successful. The data may have been read without errors, or it may have been read with errors, but corrected using the associated error correction code (ECC) stored with the data, either way it constitutes a successful read.
In an alternate embodiment, the HDD 320 may return the ECC-recovered data and subsequently remap the sector. Having read the data without a read error (no), the process continues at step 516, where the data read are returned to the requesting command initiator. The process then checks in step 518 whether all LBAs have been read. If all LBAs have been read (yes), the process returns good status to the command initiator in step 521, and then returns to step 504. If in step 518 it is determined that not all LBA's requested have been read (no), the process moves to step 520, where the LBA is incremented and the process continues at step 506 as previously described. If in step 506 it is determined that the requested LBA is mapped by the HDD 320 to the MRAM device 300 (yes), the alternate block address in MRAM 300 is obtained from the defect table in step 508, and the LBA data are read from their alternate location in MRAM 300 instep 510. The process then flows to step 512 as previously described.
If in step 512 it is determined that a read error occurred (yes), the process moves to step 522, and the read is retried. In step 523, a check is made for success. If the read retry was successful (yes) the process returns the data requested to the command initiator in step 524, and then flows to step 526, where it copies the data read from the sector to a spare location in MRAM 300. The defect table is updated in step 528, and the bad sector is remapped to MRAM device 300. The process then flows to step 518 as previously described. If in step 523 it is determined that the read retry was unsuccessful (no), in step 530 the HDD 320 returns sense to the command initiator indicating that a permanent read error has occurred. The process continues at step 532, where the defect table is updated mapping the defective sector to MRAM 300. The process then returns to step 504.
It should be noted that the embodiment described above is presented as one of several approaches that may be used to embody the invention. It should be understood that the details presented above do not limit the scope of the invention in any way; rather, the appended claims, construed broadly, completely define the scope of the invention.