The present invention relates file systems, and more particularly to the management, writing, and reading of a file on a file system.
LTFS (Linear Tape File System) is a mechanism for accessing data in a tape drive as a file in a file system. In the LTFS, metadata (such as the position and size of a data area) indicating the position on a tape of the data area constituting the file, and the like, is stored as an index in the file system. The use of LTFS enables use of the tape as a storage destination of the file in a manner similar to that of a storage device such as an HDD or a USB memory.
In the LTFS, upon editing (updating) a file, data of files previously written to the tape are not overwritten. Rather, edited data is appended after the previously written data. Upon reading data, the data is read after a magnetic head and the tape are aligned in a position where the data is written (movement of the tape and/or the magnetic head). The positioning may take time, and if an application created on the assumption of use of an HDD or a USB memory is applied to the tape, the speed of file reading operations may be very slow.
For example, as shown in
Embodiments for managing a file on a tape in a file system are disclosed. According to one aspect of the present invention, in response to a request to write a first file to a tape, it is detected whether a second file including data identical to data of the first file already exists on the tape. If the second file exists on the tape, a first index of the second file is updated. In response to completing the write of the first file to the tape, metadata, including a data starting position and a size of the first file, is added to the first index. In response to a request to read the first file or the second file, the metadata of the first index and the second index are read. Based on the read metadata, which of the first file and the second file can be accessed faster from a current head position is determined. The first file or the second file that can be accessed faster is then read from the tape.
According to another aspect of the present invention, in response to a request to write a first file to a tape, whether a second file including data identical to data of the first file already exists on the tape is detected. The first file is written onto the tape. If the second file exists on the tape, metadata of a first index of the second file is updated to include a data starting position and a size of the first file on the tape.
According to another aspect of the present invention, in response to a request to read a first file from a tape, it is detected whether other data identical to data of the first file exists on the tape. If other identical data exists on the tape, which of the data of the first file and the other identical data can be accessed faster from a current head position is determined. The data of the first file or the other identical data that can be accessed faster is then read from the tape.
Embodiments of the present invention will be described with reference to the accompanying drawings. Note that the following will describe the embodiments of the present invention while comparing it with a conventional technique as needed.
In an embodiment, the file system 100 may be an LTFS. As with an HDD, a USB memory, or other removable recording media such as a CD-R, the LTFS provides a mechanism that enables direct access to a file stored in a tape cartridge when the tape cartridge is mounted in the tape drive.
The tape cartridge 20 also includes a cartridge memory (CM) 24. The CM 24 may record, for example, in a noncontact mode using an RF interface, information, for example, about how data was written on the tape 23. For example, an index written to CM 24 of data written on the tape 23 may be accessed in a noncontact mode to enable high-speed access to the data. In
In an embodiment, the host I/F 11 communicates with the host (server) 30 or the other PC 32. For example, the host I/F 11 receives, from an OS of the host 30, a command, or request, to write data to the tape 23, a command to move the tape 23 to a target position, and a command to instruct reading of data from the tape 23. In the example of the LTFS described above, data on a tape mounted in the tape drive can be referenced directly from a desktop OS or the like, and the file can be executed by the double click or copied by the drag-and-drop action, similar to how a file is accessed on an HD.
The buffer 12 is a memory for accumulating data from host 30 to be written to the tape 23, or for accumulating data read from the tape 23 to be transmitted to host 30. For example, the buffer 12 is made up of a DRAM. Further, the buffer 12 is composed of multiple buffer segments, where each buffer segment stores a dataset as a unit of reading from or writing to the tape 23.
The channel 13 is a communication channel used to send the head 14 data to be written to the tape 23 or to receive, from the head 14, data read from the tape 23. The head 14 writes information to the tape 23 or reads information from the tape 23 when the tape 23 moves in the longitudinal direction. The motor 15 rotates the reels 21 and 22. Although the motor 15 is represented by one rectangle in
The controller 16 controls the tape drive 10. For example, the controller 16 controls writing of data to the tape 23 and reading of data from the tape 23 according to the commands accepted at the host I/F 11. The controller 16 also controls the head position control system 17 and the motor driver 18. The head position control system 17 is a system for keeping track of a desired wrap. Here, wrap means a group of multiple tracks on the tape 23. When it is necessary to switch from one wrap to another, the head 14 also needs to be electrically switched. Such switching is controlled by the head position control system 17.
The motor driver 18 drives the motor 15. As mentioned above, if two motors 15 are used, two motor drivers 18 will be provided. The CM I/F 19 is, for example, implemented by an RF reader/writer to write information to the CM 24 and read information from the CM 24.
In the LTFS, logical blocks on a tape, which are called partitions and the support of which is started from LTO-5, are used. There are two types of partitions—an index partition and a data partition. The data partition is composed of data constituting a file, and an index to be written when certain conditions are met after completion of writing the file. In the index partition, the latest index is stored and is read when a cartridge is loaded so that the position of a file on the tape can be determined. Metadata to be described later is included in the index.
(a) File offset: An indication of where data constituting this extent is located in the entire file.
(b) Partition ID: A logical ID assigned to the partition.
(c) Start block: An indication of the number of a block in which a leading part of data constituting the file is included, where the concept of block is used to indicate the position of data on the tape, and the block is set to 512 KB by default.
(d) Byte offset: An offset indicating where the head position of data starts on the block.
(e) Byte count: An indication of the number of bytes that constitute the data.
In an index of the LTFS, when a file is written onto a tape, the entire file is written as one extent. This enables the next reading of the file efficiently with one access. This extent will be further described later with reference to
Referring to
In step S1, upon writing file 1 onto a tape, a Dedup Engine determines whether another file 2 including data identical to the data of the file 1 already exists on the tape. In this example, the Dedup Engine may include conventional software technology used for Data Deduplication. In an embodiment, the Dedup Engine may be integrated into the LTFS as software, or external software or hardware called by the LTFS. If the Dedup Engine determines that a file 2 that includes data identical to the data of the file 1 already exists on the tape, the Dedup Engine returns, for example, the Offset and Length of the matching parts of data of the files 1 and 2.
In step S2, it is determined, based on the search result of step S1, whether the other file 2 including data identical to the data of the file 1 already exists on the tape. When the determination is Yes, metadata on file 2 is identified in step S3. For example, the function of the Dedup Engine mentioned above is used in acquiring this metadata. The metadata includes at least the start position and the size of data to specify an area of the identical data of the file 2 on the tape. More specifically, the metadata can include at least some or all of (a) file offset, (b) partition ID, (c) start block, (d) byte offset, and (e) byte count mentioned above. When the determination in step S2 is No, the procedure proceeds directly to step S4.
In step S4, the file 1 is written onto the tape. In step S5, the metadata on the written file 1 is updated/created. In the metadata of file 1, the metadata of file 2 acquired in step S3 is also included in the metadata on the file 1. This enables the metadata on the two files 1 and 2 including the identical data to be acquired (read) from the metadata on the file 1. As illustrated in
In step S6, the metadata on the file 2 already written on the tape is updated. The update is done in such a manner that the metadata on the file 1 newly written is added to the metadata on the file 2 originally present. This enables the metadata on the two files 1 and 2 including the identical data to be acquired (read) from the metadata on the other file 2. As in the case of the file 1, the updated metadata is written to the data partition on the tape as an index (extent) at predetermined timing (after the lapse of a certain time, or the like), and further written to the index partition at predetermined timing (when the cartridge is removed, or the like).
As in the case of step S1 in
For acquiring the metadata, for example, the function of the above-mentioned Dedup Engine is used. Then, the metadata on the file 2 is updated to add, to the acquired metadata on the file 2, the metadata on the file 1 updated in step S12. In step S16, the metadata on the file 1 is further updated to add, to the metadata on the file 1 updated in step S12, the metadata on the file 2 originally present and acquired in step S15. In step S15 and step 16, based on the respective metadata updated, metadata on the two files 1 and 2 including the identical data can be acquired (read) from each metadata on the file 1 or the other file 2. In any of these cases, the updated metadata is written to the data partition on the tape as an index (extent) at predetermined timing (after the lapse of a certain time, or the like), and further written to the index partition at predetermined timing (when the cartridge is removed, or the like).
Information on extents is stored with corresponding tags <extent>tags. When one file is composed of multiple extents, the file has two or more <extent>tags. In the example of
In the example of
In step S22, it is searched whether metadata (extent) including data identical to the data of the file 1 exists on the tape. In this search, a determination can be made by determining whether <dupextent> as shown in E3 or E4 of
In step S25, it is determined which of the identical data found and the data of the file 1 can be read faster from the current position of the head. The determination can be made, for example, by using a conventional technique, such as a method of determining the order of reading data as disclosed in PCT International Publication No. WO2010/073776. This method of determining the order of reading data is implemented in a tape drive so that the determination result can be acquired from the tape drive. In step S26, data that can be read faster and obtained in step S25 is read. When two or more identical data exist, data the reading of which is the fastest in all the data including that of the file 1 is selected and read.
In this state, the data arrangement on the tape is as shown in
The embodiments of the present invention have been described with reference to the accompanying drawings. However, the present invention is not limited to these embodiments. Further, the present invention can be carried out in other modes to which various improvements, modifications, and variations are added based on the knowledge of those skilled in the art without departing from the scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2014-143728 | Jul 2014 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
6675177 | Webb | Jan 2004 | B1 |
6941328 | Cannon | Sep 2005 | B2 |
8832365 | Sims | Sep 2014 | B1 |
8954663 | Klein | Feb 2015 | B1 |
9058843 | Iwanaga | Jun 2015 | B2 |
9063666 | Amir | Jun 2015 | B2 |
9235347 | Klein | Jan 2016 | B2 |
9323776 | Sims | Apr 2016 | B2 |
9348837 | Iwanaga | May 2016 | B2 |
9430155 | Amir | Aug 2016 | B2 |
20110219184 | Jaquette et al. | Sep 2011 | A1 |
20120179868 | Haustein et al. | Jul 2012 | A1 |
20140201424 | Chen et al. | Jul 2014 | A1 |
20140358871 | Cideciyan et al. | Dec 2014 | A1 |
20140379980 | Hasegawa | Dec 2014 | A1 |
20150046645 | Iwanaga | Feb 2015 | A1 |
20150149415 | Iwanaga | May 2015 | A1 |
20150293935 | Abe | Oct 2015 | A1 |
20150347022 | Ashida | Dec 2015 | A1 |
20150363119 | Itagaki | Dec 2015 | A1 |
20160012073 | Ashida et al. | Jan 2016 | A1 |
20160098221 | Klein | Apr 2016 | A1 |
20160203160 | Sims | Jul 2016 | A1 |
Number | Date | Country |
---|---|---|
2011197977 | Oct 2011 | JP |
2016161185 | Aug 2013 | JP |
2013182476 | Sep 2013 | JP |
2013206518 | Oct 2013 | JP |
2010073776 | Jul 2010 | WO |
Entry |
---|
Decision of Refusal, Patent Application No. 2014-143728, Date of Drafting: Aug. 24, 2016, 6 pages. |
Decision to Grant a Patent, Patent Application No. 2014-143728, Date of Drafting: Oct. 31, 2016, 6 pages. |
List of IBM Patents or Patent Applications Treated as Related, dated Jan. 12, 2017, pp. 1-2. |
Application No. 2014-143728 (Japan), titled “Method of Managing, Writing, and Reading File on Tape,” filed on Jul. 11, 2014, 33 pages. |
Number | Date | Country | |
---|---|---|---|
20170125061 A1 | May 2017 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 14719344 | May 2015 | US |
Child | 15405667 | US |