This application claims priority under from Korean Patent Application No. 10-2009-0076150, filed on Aug. 18, 2009, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
Exemplary embodiments relate to a memory apparatus, and more particularly, to a storage device providing a function to automatically backup data in the storage device without a command from a host or a user.
In a relate art used data backup and restoration method, data stored in a storage device is backed up and the backup data is restored, by using a function provided by an operation system (OS). Also, a user may install an application/program for performing backup at a host, for example, a computer, and the data stored in the storage device is partially or totally copied and compressed, for backup, by using the installed application/program. The backup data is restored when necessary.
When the data backup is performed by the above backup method, since a portion of the storage device is always assigned for the storage of backup data, the capacity of the storage device assigned for the backup is large and actual usability is low.
One or more exemplary embodiments provide a storage device which performs data backup in a predetermined method in the storage device without a command from an operation system (OS) or a user.
One or more exemplary embodiments also provide a storage device which performs data backup by dynamically searching for a empty space in the storage apparatus, instead of having a fixed space assigned as a backup space, thereby improving usability of the space of the storage apparatus.
One or more exemplary embodiments also provide a storage device which automatically performs data backup even when an OS or a user does not perform data backup. Thus, when a file is damaged, a backup file is automatically searched for and read out so that reliability of the storage device may be improved.
According to an aspect of an exemplary embodiment, there is provided a storage device having an automatic backup function which is connected to a host apparatus to store user data, the storage device including a storage medium which stores the user data, and a controller which controls data writing and reading of the storage medium, wherein when the storage device is in an idle mode, the controller backs up at least a portion of the user data stored in the storage medium in an available region of the storage medium.
The controller may search for a location where at least a portion of the user data is backed up and back up the at least the portion of the user data at a searched location.
The controller may divide the storage medium into a plurality of blocks. When the at least the portion of the user data is written to a first block of the plurality of blocks, the controller may determine the first block to be a target backup block to be backed up and back up data of the first block in a second block of the available region. The controller may store matching information indicating that the second block is a backup block of the first block in the storage medium or at least one of memories provided in the storage medium.
The controller may receive from the host a read command to read the first block. When a read error is generated in the first block, the controller may provide the host with backup data stored in the second block based on the matching information. When a write command to write second user data to the second block is received, the controller may write the second user data to the second block.
The controller may set that the first block has the higher backup priority among target backup blocks. When at least a partial area of the first block is determined to be a defect, the controller may reassign the at least a partial area to another area of the storage medium and copy a backup area corresponding to the at least the partial area of the second block to the other area that is reassigned.
The controller may determine whether to backup at least a portion of the user data in the available region, or erase at least a portion of the user data that is backed up, based on a type of data of the at least the portion of the user data.
According to an aspect of another exemplary embodiment, there is provided a storage device having an automatic backup function which is connected to a host apparatus to store user data, the storage device including a storage medium which stores the user data, and a controller which controls data writing and reading of the storage medium, wherein the controller divides the storage medium into a plurality of blocks, and when at least a portion of the user data is written to a first block of the plurality of blocks, the controller backs up data of the first block in a second block that is an available region of the storage device.
The above and/or other aspects will be more clearly understood from the following detailed description of exemplary embodiments taken in conjunction with the accompanying drawings in which:
Exemplary embodiments will be described in detail with reference to the attached drawings. Like reference numerals in the drawings denote like elements.
The storage device 100 supporting an automatic backup function may be employed for a large capacity storage device such as a hard disk drive (HDD), a solid state disk (SSD), or a flash memory. Although, in the present specification, the storage device 100 supporting an automatic backup function is an HDD, the inventive concept is not limited thereto.
The controller 110 of the storage device 100 receives a write command to write data or a read command to read the data recorded in the storage medium 120 of the storage device 100 supporting an automatic backup function, from a host 200, for example, a computer. Then, the controller 110 may control the storage medium 120 to perform an operation corresponding to the received command or predetermined devices to perform a data write/read operation with respect to the storage medium 120.
The controller 110 performs a variety of controls needed for driving the storage device 100 supporting an automatic backup function. For example, to perform a data write operation to the storage medium 120, for example, a disk 120, the controller 110 outputs data to be written to the magnetic head 130 via the R/W channel circuit 180 and the pre-amplifier 170, and controls the location on the storage medium 120 where the data is to be written by controlling the VCM driving unit 150 and the spindle motor 160. A predetermined firmware is utilized by the controller 110 to perform the above-described operation or other various operations. The firmware may be included in the controller 110 or stored in a predetermined memory (not shown), for example, a random access memory (RAM) or NOR flash memory, connected to the controller 110. The firmware may include predetermined codes.
Referring back to
Herein, the idle mode signifies a time during which the storage device 100 substantially performs no operation after the operation to perform the command received from the user and/or the OS is completed, regardless of the operation of the storage device 100 supporting an automatic backup function. Thus, the storage device 100 may backup the user data recorded on the storage medium 120 in an empty (or blank) space, that is, an available region, of the storage medium 120 by a predetermined method using the controller 110 and firmware driven by the controller 110, as described later. As a result, data backup may be performed without deterioration of the performance of the storage device 100 supporting an automatic backup function or without hindrance to the operation desired by the user.
Herein, the user data includes not only data that the user records on the storage medium 120 via the host 200, but also all meaningful data stored in the storage medium 120 such as the OS needed to operate the host 200. Also, the available region includes a region of the storage medium 120 where data may be newly written. The available region does not necessarily include a blank space where no data is written. In an actual HDD, when data is erased, not only is the data erased from the storage medium 120, but also location information for pointing the data is erased so that the data may be overwritten.
The backup method of the storage device 100 supporting an automatic backup function will be described below. The storage device 100 supporting an automatic backup function may automatically backup user data without being noticed by the user. Thus, a region where backup data of the user data is stored may be actually recognized by the user as an available region. When a write command to write a predetermined data at a location where the backup data is stored is performed according to a command from the user and/or OS, the storage device 100 may give up the backup data and write the predetermined data. As a result, according to the storage device 100, a backup location of data may dynamically vary.
When the controller 110 tries to backup part or all of the user data, a location of the storage medium 120 where backup may be actually performed is searched for and a backup is performed at the searched location. Thus, since the backup is not performed at a particular fixed space, usability of space may be improved.
The controller 110 may divide the storage medium 120 into predetermined units of blocks and perform backup for each block. That is, as the backup is performed in the idle mode in units of blocks, even when the idle mode is short in duration, the backup may be partially performed. Thus, even when the available region of data is not physically continuous on the storage medium 120, the backup may be efficiently performed.
Also, the controller 110 may maintain matching information indicating the relationship between a block where the original data exists and a block where the original data is copied, that is, a backup block, in the storage medium 120, for example, a maintenance cylinder of the HDD, or a separate memory, for example, a DRAM, an SRAM, or buffer, of the storage device 100 supporting an automatic backup function. The matching information may be maintained as a matching table that is a predetermined table form, as illustrated in
In
When the user data is written to at least a portion of any one of the blocks, the controller 110 may determine the block to be a target backup block.
When at least a portion of user data is written to any one block, it may signify that not only a case of a block in which data is fully stored but also a case of a block in which data is partially stored becomes a target backup block according to an exemplary embodiment. In other words, backup may be performed either when a block is full of data or when a block is partially filled with data. The controller 110 may use a variety of methods to determine whether a block is fully or partially filled with data. For example, in the case of an HDD, a host command output from the host 200, that is, information about a write address included in a write command, may be stored in the maintenance cylinder. Also, whether a block is a target backup block may be determined based on the write address.
When a block is determined to be a target backup block, the controller 110 may backup the target backup block in a predetermined order of priority or sequentially in the idle mode of the storage device 100 supporting an automatic backup function.
For example, as illustrated in
That is, as illustrated in
Then, as illustrated in
The controller 110 may set the order of priority to perform backup to the target backup blocks, by writing different information, for example, “−1” or “0”, as the information about the backup block of the target backup block, for example, Block 1 and 2 or Blocks 1001 and 51001.
When “0” is written as the information about a backup block (the Copied Data Block field), any data may be written to a corresponding block. For example, when Block 1 or Block 2 that is backed up and then the backup block is erased as user data is written to the backup block, that is, Block 50001 or 50002, of Block 1 or Block 2, “−1” may be written as the information about the backup block, wherein “−1” may indicate one of the target backup blocks that is first to be backed up.
When new data like Block 1001 or Block 51001 is written, no available region for backup is left. Thus, when new data is written to Block 1001 or Block 51001, “−2” may be written as the information about the backup block, wherein “−2” may indicate one of the target backup blocks that is second to be backed up. Accordingly, since the controller 110 sets the order of priority of the target backup blocks according to a predetermined standard, there is an effect of providing an efficient backup algorithm and a priority order suitable for a predetermined standard even when the backup space is insufficient.
Referring to
According to the above-described storage device 100 supporting an automatic backup function, when the controller 110 receives a command from the host 200 to read data in an area corresponding to a particular block or a portion of the particular block, the controller 110 may perform a data read operation. The controller 110 may transmit the read data to the host 200. When an error is generated in the data transmitted to the host 200, the controller 110 may determine the backup block of the data based on the information included in the matching table, that is, matching information, and provide the host 200 with at least a portion of the information stored in the backup block corresponding to the data. The particular block where the original data is located is overwritten by the information stored in the backup block so that the data may be automatically restored. According to an exemplary embodiment, the controller 110 may determine whether a read error is generated. In such a case, the data may be restored in a similar process.
When at least a partial area of a particular block is determined to be defective, the controller 110 may reassign the at least a partial area to other area of the storage medium 120 and copy data of the backup area corresponding to the at least a partial area of the backup block of the particular block to the other area that is reassigned. The determination of a defective area by the controller 110 may be performed in a variety of methods according to an exemplary embodiment. For example, a particular area may be determined to be defective when a read error is repeatedly generated or over a predetermined number. According to the storage device 100 supporting an automatic backup function, when a defect is generated in the storage medium 120, the storage device 100 automatically reassign a defect area and restores the data backed up in the reassigned area, thereby improving reliability of the storage medium 120.
When a space for backup is insufficient, the storage device 100 supporting an automatic backup function may erase the backup data of the data according to the type of data to secure the backup space in the storage medium 120. Also, the storage device 100 may not perform backup by previously determining whether to perform backup according to the type of the original data. For example, when the user data is contents such as video or music and the importance of backup of the contents is determined to be low, the controller 110 may recognize the type of user data based on the file name of the user data or using other various methods. When the user data is a predetermined type of data, the controller 110 may not perform backup or erase the backup block of the user data even when the user data is backed up, thereby increasing the backup space. Such operation is performed in the idle mode of the storage device 100 supporting an automatic backup function. When a space over a predetermined rate is used from the total capacity, the controller 110 may determine that the backup space is insufficient.
When the capacity of the storage medium 120 is full (S60-YES), the controller 110 monitors a data erase command received from the host 200 (S70). When data of a particular block X is all erased (S80), information written in relation to the block X may be initialized in the matching table (S90). The initialization may denote that the matching table is corrected to reflect the backup relation and/or the priority order after the block X is erased as described in
When the storage device 100 supporting an automatic backup function is in the idle mode (S150-YES), the N-th block that is indicated as a block to be restored is restored as the data of Block B is coped to the N-th block (S160). The controller 110 may scan whether a read error is generated in the N-th block (S170). When a read error is generated (S180-YES), it is determined that a defect is generated in a physical storage medium corresponding to the N-th block. In such a case, the location in the N-th block where the error is generated is reassigned and then backup data is copied to the reassigned location, thereby performing a defect process (S190).
The method to provide the storage device 100 supporting an automatic backup function according to the present inventive concept can also be embodied as computer readable codes on a computer readable recording medium. The computer readable recording medium may be any data storage device that can store data which can be thereafter read by a computer system. Examples of the computer readable recording medium include read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tapes, floppy disks, optical data storage devices, etc. The computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion. Also, functional programs, codes, and code segments for accomplishing the present invention can be easily construed by programmers skilled in the art to which the present invention pertains.
According to the storage devices supporting an automatic backup function according to the exemplary embodiments, since the storage device automatically performs data backup in the idle mode of the storage device, reliability of the storage device may be improved without deteriorating performance of the storage device that is actually sensed by a user. Also, since the storage device does not previously assign a space for backup or the assigned space is not fixed, the space is dynamically utilized so that efficiency in use of the memory space may be improved. Furthermore, since data that is unnecessary or has a low necessity for backup is previously set and backup data is erased according to the type of data when the backup space is insufficient, the efficiency of backup may be improved.
While exemplary embodiments have been particularly shown and described, it will be understood that various changes in form and details may be made therein without departing from the spirit and scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2009-0076150 | Aug 2009 | KR | national |