Embodiments of the present invention relate to a data reassign method and a storage device.
In the prior art, the HDD (Hard Disk Drive) has a physical sector size of 512 bytes, and has a structure in which additional information such as redundant data exists every sector. However, in recent years, HDDs expanded to 4096 bytes in physical sector size and called “advanced format” have become provided. By doing so, eight pieces required for user data of 4,096 bytes in the prior art can be collected into one piece. As a result, there is a merit that an area where user data is recorded is expanded and it becomes possible to use long redundant data every sector.
However, there are a large number of hosts who still use the logical sector size of 512 bytes. For using an HDD device using the physical sector size of 4,096 bytes in such hosts, the so-called emulation function of behaving to the host as if the sector size is 512 bytes and operating inside with a sector size of 4,096 bytes becomes necessary in the HDD device. If data reassignment with a logical sector taken as the unit is ordered from the host, data is reassigned with a physical sector taken as the unit in the HDD device and consequently reassignment is not executed suitably.
An embodiment of the present invention provides, in a storage device having a recording medium, a data reassign method of rewriting data on the recording medium by taking a physical sector including a plurality of logical sectors each forming a management unit in a command from a host, as a management unit, in response to receipt of a reassign command for rewriting data on the recording medium into a different area from the host. The data reassign method in the embodiment includes: when a reassign command specifying a first logical sector that is included in a first physical sector and that has not been specified yet by the reassign command is received, reassigning data in the first physical sector to a second physical sector different from the first physical sector; and refraining thereafter from reassigning data in the second physical sector until occurrence of either re-receipt of the reassign command for the first logical sector or second-time or later receipt of a reassign command for a second logical sector other than the first logical sector included in the second physical sector.
Hereafter, a data reassign method and a storage device according to an embodiment will be described in detail with reference to the accompanying drawings. Note that the present invention is not restricted by this embodiment.
To reassign (alternate) data means to copy data in a storage area which has become unusable by some reason such as a failure onto a separately provided reassign area (alternate area). In the present embodiment, a case in which reassignment of data on the medium 3 is executed in accordance with a command from the host 1 will be described. As for a command (reassign command) given by the host 1 to order to reassign data, there is a REASSIGN BLOCKS command as an example of SAS (Serial Attached SCSI). In the ensuing description, this is taken as an example. However, a reassign command given by the host 1 to order to reassign data is not restricted to this.
The R/W channel 6 is a signal processing device configured to process a signal group relating to reading/writing. The R/W channel 6 digitizes read data, and decodes the read data from the digitized data. Furthermore, the R/W channel 6 encodes write data.
The HDC 5 has a host interface function, and the HDC 5 is connected to the host 1. The HDC 5 receives a command transferred from the host 1. The HDC 5 controls data transfer between the host 1 and the HDC 5. The HDC 5 controls data transfer between the medium 3 and the HDC 5. The HDC 5 controls the buffer 7.
The buffer 7 is, for example, a RAM. The buffer 7 temporarily stores data to be written onto the medium 3 and data read out from the medium 3 via the R/W channel 6.
In the present embodiment, the size of a physical sector which is a management unit of reading from and writing onto the medium 3 is greater than the size of a logical sector which is a management unit of reading and writing conducted by the host 1 as illustrated in
In the case as illustrated in
Hereafter, reassign processing of data under execution of the emulation will be described.
In the present embodiment, REAS flags which are flags (management information) corresponding to the number of logical sectors included in each physical sector of data retained on the medium 3 as illustrated in
It is supposed that at first all REAS flags corresponding to eight logical sectors (LBA (Logical Block Address)=0 to 7) in a certain physical sector are “0” as illustrated in
Specifically, if the HDC 5 (host interface) receives the REASSIGN BLOCKS command from the host 1 (step S1 in
For example, if the REASSIGN BLOCKS command is issued for LBA=4 by the host 1, the REAS flag of the logical sector of LBA=4 illustrated in
On the medium 3, it is also possible to provide a physical sector for the reassign area separately from a physical sector used to record ordinary data. For example, as illustrated on the medium 3 in
Referring back to
Hereafter, a case (the step S1) in which the host 1 further issues the REASSIGN BLOCKS command to LBA=0 in a state after data of LBA =0 to 7 from the first physical sector are reassigned to the second physical sector as illustrated in
In cases where the REASSIGN BLOCKS command is issued for a logical sector (LBA32 4) included in a certain physical sector and in addition the REASSIGN BLOCKS command is issued for a different logical sector (LBA=0) included in the same physical sector, reassignment of a physical sector is executed each time in the prior art. In other words, it is conducted in the prior art to reassign a physical sector immediately after reassignment to a different reassign area 32 again, resulting in a problem of wasteful consumption of the reassign area 32. However, if the host 1 issues a plurality of reassign commands for different logical sectors in the same physical sector and reassignment of a physical sector is executed once, the data reassign method in the present embodiment makes it possible to cope with ensuing reassign commands by only operating REAS flags without repeating reassignment of the physical sector. As a result, wasteful consumption of the reassign area 32 can be reduced. Furthermore, as compared with management of reassign history using a table, management using flags becomes profitable in memory consumption and processing speed. Furthermore, it becomes possible to reduce the number of times of writing.
In cases where the medium 3 is mounted as illustrated in
With respect to a plurality of reassign commands for different logical sectors in the same physical sector from the host, reassignment of the physical sector is not repeated after reassignment of the physical sector is executed once, according to the embodiment. As a result, it is possible to obtain an effect that wasteful consumption of the reassign area can be reduced.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from Provisional Patent Application No. 61/847451, filed on Jul. 17, 2013; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61847451 | Jul 2013 | US |