If the flushing is set to execute when the data amount stored in the nonvolatile buffer memory 103 exceeds 70 MB beforehand, the control unit 101 sets the immediate bit to “1” during the amount of sets of data does not exceeds 70 MB. That is, the control unit 101 keeps response to the host computer that the writing “Completion” to the magnetic tape and no flushing should be executed. Sets of data, Nth set of data from the first set of data, are accumulated in nonvolatile buffer memory 103. If the data amount memorized in nonvolatile buffer memory 103 exceeds 70 MB when the nonvolatile buffer memory 103 continuously receives the (N+1)th data, The control unit 101 executes flushing of (N+1) sets of data accumulated in the nonvolatile buffer memory 103. Sets of data that has been accumulated in nonvolatile buffer memory 103 are written to the magnetic tape in a magnetic cartridge tape 106 by the write head of R/W head 105 through a write channel of R/W channel 104.
As for a magnetic cartridge tape 106, the magnetic tape movement of a magnetic cartridge tape 106 is controlled by a motor not shown in the figure, and the motor is being controlled by motor driver 107. When the nonvolatile buffer memory 103 receives the (N+1)th set of data, the control unit 101 responds to the host computer 2 writing “Completion” to the magnetic tape. And a flushing is executed. Even if power is lost soon after the flushing, as the host computer 2 has already sent the (N+1) sets of data to the magnetic tape storage 1, the control unit 101 can easily recovers the (N+1) sets of data using the (N+1) sets of data memorized in the nonvolatile buffer memory 103 after restoring the power supply. And the sets of data not has been written to the magnetic tape will be written to the magnetic tape, and the written data to the tape will be examined concurrently by the read-after-write function of the magnetic tape storage 1. In the process sets of data are accumulated in the nonvolatile buffer memory 103, for instance, an identification number or a serial number that specify the tape mark of each set of data can be written in each data. Even if the power supply is lost, the control unit 101 can easily specify tape mark included in each set of data when the power supply is restored. Thus, when sets of data memorized sequentially in the nonvolatile buffer memory 103 or the order of sets of data is changed for some reasons, magnetic tape storage 1 can easily recover the sets of data keeping consistency with the host computer 2.
Plural nonvolatile buffer memories may be provided with a magnetic tape storage 1 in
As a example of the present invention, for instance, it is supposed that the memory capacity of the nonvolatile buffer memory is 128 MB. The stored data size in the nonvolatile buffer memory is checked by the tape drive control unit in the magnetic tape storage. If it is decided beforehand that the flushing is executed when the data amount of sets of data in the nonvolatile memory exceeds 70 MB and the sets of data are written to a magnetic tape. Therefore, the magnetic tape storage receives the first set of data from the host computer and stores the first set of data in the nonvolatile buffer memory, subsequently, the magnetic tape storage receives one set of data after another from the host computer and stores the first set of data in the nonvolatile buffer memory until the data amount exceeds 70 MB. When the magnetic tape storage receives the last set of data that makes the data amount in the nonvolatile buffer memory exceeds 70 MB, the magnetic tape storage executes a flushing. The sets of data stored in the nonvolatile buffer memory are written to the magnetic tape.
Conventionally, whenever a magnetic tape storage receives one file and one tape mark (that shows the end of one file) from the host computer, the magnetic tape storage stores the file in a volatile buffer memory, subsequently, the magnetic tape storage executes a flushing. And the file and a tape mark are written to a magnetic tape. In this process, only the file is stored in the volatile buffer memory excluding the tape mark. A flushing is executed for each file even if the file size of one file is a small. One tape reposition is executed after the flushing to locate the write head in the first position where the following file to be written. Moreover, when the file is written to the magnetic tape, the file placed between tape marks is considers as the object of data verification.
In the present invention, a magnetic tape storage recognizes one file and one tape mark as one set of data. And a set of data written to a magnetic tape is considers as the object of data verification. In the present invention, the control unit of a magnetic tape storage recognizes as one set of data when magnetic tape storage receives a file and tape mark from the host computer, and a file and tape mark are memorized in a nonvolatile buffer memory. Since the memorized data amount in the nonvolatile buffer memory is checked by the control unit, The control unit recognizes the data amount of 500 KB is kept in the nonvolatile buffer memory when the first set of data of 500 KB is memorized in the nonvolatile buffer memory. Herein, it is supposed that the memory capacity of the nonvolatile buffer memory is 128 MB. If it is decided beforehand that a flushing is executed when the data amount in the nonvolatile buffer memory exceeds 70 MB, the control unit keeps immediate bit to “1”, that means, the control unit keeps responses to the host computer writing “Completion” to the magnetic tape and no flushing is executed during the total data amount in the nonvolatile buffer memory is within 70 MB. N sets of data are stored in the nonvolatile buffer memory, and if the data amount in the nonvolatile buffer memory exceeds 70 MB at the time of receiving the (N+1)th set of data, a flushing is executed and (N+1) sets of data in the nonvolatile buffer memory are written to a magnetic tape.
Thus, when the nonvolatile buffer memory receives the (N+1) th set of data, the control unit executes a flushing. The host computer has sent (N+1) sets of data to the magnetic tape storage at this time. Even if the magnetic tape storage enters power-lost-state immediately after this, the magnetic tape storage keeps data consistency with the host computer since these sets of data can be recovered by the (N+1) sets of data memorized in the nonvolatile buffer memory.
According to the present invention, the accumulated plural sets of data in the buffer memory are written to a magnetic tape efficiently and reduced the frequency of the flushing and the tape reposition. Moreover, the magnetic tape storage can restore data by keeping consistency with the host computer by the data memorized in the nonvolatile buffer memory without disappearing any data sent from the host computer even if power of the magnetic tape storage is lost.
In this invention, a pair of one file and one tape mark is recognized a set of data. For instance, by adding an identification number to each data, if power is lost, the control unit of the magnetic tape storage can recover all sets of data stored in a nonvolatile buffer memory quickly.
Moreover, magnetic tape library is also a kind of magnetic tape storage in the present invention.
Furthermore, plural nonvolatile buffer memories may be provided in the magnetic tape storage.
A magnetic tape storage writes plural sets of data stored in a nonvolatile buffer memory to a magnetic tape with a write head, the sets of data written to the magnetic tape are read from the magnetic tape with a read head, and sets of data are verified by the means to verify the sets of data written in the magnetic tape.
In a magnetic tape storage by the present invention a pair of one file and one tape mark received from a host computer is handled as a set of data. Conventionally, in a magnetic tape storage, each file placed between tape marks is the object of data verification. In the present invention, a pair of a file and a tape mark is recognized as a set of data. In addition, an identification number may be added to one data. A set of data is an object of data verification. So, for instance, the magnetic tape storage will be able to use the plural sets of data saved in the nonvolatile buffer memory to keep consistency with the host computer, if power is lost. An identification number may be written in header of a file.
For instance, plural set of data are written on the magnetic tape by the multiplexer channel head of 16 tracks and those sets of data written on the magnetic tape are read soon after the writing by the multiplexer channel read head of 16 tracks by the read-after-write function means. Write data check examines if the data written on the magnetic tape and data in the buffer memory are the same or not. In the case of an error is detected, the control unit takes out the set of data corresponding to the set of data that the error occurs from the nonvolatile buffer memory, the set of data is written again after just behind the set of data being written now or after some sets of data. In this case, the information that the order of sets of data is discontinuous should be involved in the relating sets of data, or the control unit may control the order of sets of data based on the identification number written in another nonvolatile buffer memory.
In the present invention, as above-mentioned, a pair of one file and one tape mark is recognized as one set of data. The recovery of data is not expected by using a conventional volatile buffer memory in the case of power-lost. But by the present invention, data recovery is executed easily and surely.
Moreover, according to the present invention, if power is lost when the sets of data received from the host computer are memorized in the nonvolatile buffer memory or while the sets of data are written to the magnetic tape, the magnetic tape storage will be initialized itself after the power supply is restored. The magnetic tape storage by the present invention has the means to make the magnetic tape storage ready state without losing data according to the sets of data kept to a nonvolatile buffer memory.
Even if the power supply of magnetic tape storage is lost while the sets of data are written to the magnetic tape, sets of data stored in a nonvolatile buffer memory never disappears. Neither the files nor tape marks of sets of data will be lost. The sets of data can be utilized for recovering data.
Further, the method of writing data to a tape by the present invention, one file and one tape mark received from the host computer are recognized as one set of data and plural sets of data are memorized in a nonvolatile buffer memory of the magnetic tape storage. In the case of the data amount of plural sets of data memorized in the nonvolatile buffer memory doesn't come up the memory capacity that is decided beforehand in the nonvolatile buffer memory, another set of data is continuously memorized in the nonvolatile buffer memory. When the data amount of plural sets of data memorized in the nonvolatile buffer memory comes up the memory capacity that is decided beforehand in a nonvolatile buffer memory, plural sets of data memorized in the nonvolatile buffer memory is written to the magnetic tape.
A storage medium on which is stored a program for writing data to a magnetic tape in a magnetic tape storage. The magnetic tape storage memorizes sets of data in a nonvolatile buffer memory, a set of data including one file and one tape mark (showing the end of the file) received from a host computer. The magnetic tape storage stores sets of data continuously in the nonvolatile buffer memory until total data size of sets of data comes up to a predetermined data amount. The magnetic tape storage writes sets of data stored in the nonvolatile buffer memory to a magnetic tape when total data amount of sets of data exceeds said predetermined data amount.
Number | Date | Country | Kind |
---|---|---|---|
2006-186047 | Jul 2006 | JP | national |