File system implementing write once read many (WORM)

Abstract

The embodiments deal with files that are already present in a storage when mounting the storage in a file system and files created after the mounting as different groups. (Metadata of) the files is classified. The files are each divided into metadata (index) and a file main body and are recorded on different storage areas, that is, an index partition (IP) and a data partition (DP), associated with each other. This file system is effective in a storage format in which a new file is merely written and an already written file is not updated or deleted (for example, a tape medium used in the LTFS). The embodiments implement a WORM file system by rejecting a request to update or delete a file that is present at mounting as a WORM file and permitting update or deletion of a file that is created after mounting until the storage is unmounted.

Claims

1. A method for a file system to classify files in a mounted storage in a storage format in which the files are each divided into metadata and a file main body and are recorded in association with each other, and in which a new file is merely written, and an already written file is not updated or deleted, the method comprising: making a first determination whether a file present in the mounted storage has already been present in the storage when the storage is mounted; classifying, responsive to the first determination being affirmative, using a processor and a memory, the file as belonging to a first group as a Write-Once-Read-Many (WORM) file; rejecting, responsive to the file belonging to the first group, at least one of an update and a deletion of the file; classifying, responsive to the first determination being negative, when the file is written after the mounting, the file as belonging to a second group as a Read/Write (R/W) file; permitting, responsive to the file belonging to the second group, at least one of the update and the deletion of the file; making a second determination, when the mounted storage is accessed for a write operation from outside a data processing system where the storage is mounted, that an access target belongs to the first group, the access target including the file; rejecting by the file system, responsive to the second determination, at least one of the update and the deletion of the file; making a third determination, when the mounted storage is accessed from outside the data processing system, that an access target belongs to the second group, the access target including the file; and permitting by the file system, responsive to the third determination, at least one of the update and the deletion of the file.

2. The method according to claim 1, wherein when the storage is mounted, all indices corresponding to all files in the storage are read, and the rejecting and the permitting are executed for all the indices.

3. The method according to claim 2, further comprising: storing a result of the classifying the file as belonging to the first group and a result of the classifying the file as belonging to the second group in a table coupled to the file system.

4. The method according to claim 3, wherein the table is a hash table.

5. The method according to claim 1, further comprising: executing the making depending on whether an identifier of the file is greater than a largest identifier at mounting, the identifier being recorded on the index and numbered in an order of creation.

6. The method according to claim 1, wherein the mounted storage is a tape medium.

7. The method of claim 1, wherein the classifying responsive to the first determination being negative comprises classifying the metadata of the file, and the at least one of the update and the deletion of the file comprises at least one of an update and a deletion of the metadata of the file.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) FIG. 1 is a diagram illustrating mounting of a storage medium.

(2) FIG. 2 is a schematic diagram illustrating a format of a tape medium divided into two partitions, called an index partition (IP) and a data partition (DP), for use in the LTFS.

(3) FIG. 3 is a schematic diagram illustrating a state in which new files are written to the format in FIG. 2.

(4) FIG. 4 is a flowchart for reading an index from the IP at mounting and storing the index into a data structure.

(5) FIG. 5 is a diagram illustrating a data structure (table) according to an embodiment of the present invention.

(6) FIG. 6 is a flowchart for processing write access to a mounted storage medium from the outside.

(7) FIG. 7 is a matrix showing the mutual relationship between file type and medium type according to an embodiment of the present invention.

DETAILED DESCRIPTION

(8) FIG. 1 is a diagram illustrating mounting of a storage medium.

(9) An example of the storage medium is a tape medium.

(10) The storage medium is mounted in a storage drive.

(11) An example of the storage drive is a tape drive.

(12) In the present invention, a mounted state is a state in which the storage medium can be accessed from the outside.

(13) Accordingly, the term mounted storage has technical meaning only for comparison with an unmounted storage and thus should be widely interpreted in this respect.

(14) In the example of FIG. 1, the storage medium shifts from state (A) to state (B), bringing access to the tape medium to READY.

(15) Actually, a desired recording portion in the tape medium is specified while the tape medium is physically wound, and writing is performed through a head provided in the tape drive.

(16) In managing the index of a file, the LTFS in the related art has managed the index with a single data structure irrespective of whether the file is already present at mounting or created after mounting.

(17) FIG. 2 is a schematic diagram illustrating a format of a tape medium divided into two partitions, called an index partition (IP) and a data partition (DP), for use in the LTFS.

(18) This shows a state after formatting, in which no file is written, and index after formatting is written.

(19) FIG. 3 is a schematic diagram illustrating a state in which new files 1 and 2 are written to the format in FIG. 2.

(20) Index after formatting in the partition (IP) is updated to an index including metadata of file 1 and file 2 to change to latest index.

(21) However, note that the writing of the new files (file 1 and file 2) to the data partition (DP) is merely addition and that an already written file is not updated or deleted.

(22) Here, although each file is divided into the metadata and the file main body of the file, they are recorded in association with each other.

(23) Specifically, since not only index after formatting in the index partition (IP) is updated to index including metadata of file 1 and file 2 to change to latest index, but also index including metadata of file 1 and file 2 is additionally written to the data partition (DP), the mutual relationship is kept recorded.

(24) Such a storage format is an effective storage format for application of the present invention.

(25) FIG. 4 is a flowchart for reading an index from the IP at mounting and storing the index into a data structure.

(26) In step 100, mounting is started.

(27) In step 200, an index of a file present in a mounted storage medium is read from the IP.

(28) In step 300, it is determined whether the storage medium is a WORM medium or not.

(29) If the determination result in step 300 is Yes, the metadata of the file determined to have been present in the storage medium before mounting is classified as a first group in which update or deletion of the file is rejected (as a WORM file) in step 400.

(30) If the determination result in step 300 is No, the metadata of the file written after mounting is classified as a second group in which update or deletion of the file is permitted (as a R/W file) in step 500.

(31) When the storage medium is mounted, all indices in the storage medium may be read, and such classification may be repeated for all the indices.

(32) In step 600, the mounting is terminated. Indices of files created after mounting are always registered with the R/W group irrespective of whether the tape medium is a WORM medium or a R/W medium.

(33) In the LTFS, since individual files have corresponding IDs numbered in the order of creation to increase uniquely, called UIDs, the data structure itself may be an integrated structure, so that it can be determined whether the individual files belong to the R/W group or the WORM group by comparing the values of the UIDs of the files are greater than the largest UID at mounting.

(34) In the present invention, the data structure in which indices are managed is divided into two data structures of the WORM group and the R/W group (for example, a hash table).

(35) FIG. 5 is a diagram illustrating a data structure (table) according to an embodiment of the present invention.

(36) The result of classification according to the flowchart in FIG. 4 may be stored in the memory in the file system (FIG. 1) in the form of the data structure (table).

(37) Of course, the result may be stored not only in the file system but also a table (not shown) connected to the file system.

(38) The classified data structure also presents a characteristic of the present invention.

(39) FIG. 6 is a flowchart for processing write access to the mounted storage medium from the outside.

(40) In step 700, a file update request, e.g. addition, update, and deletion of data of a file, and update of metadata of the file (e.g. file name) are given.

(41) In step 800, it is determined whether the index of the file is registered with the R/W group.

(42) If the index is registered with the R/W group, change/deletion is permitted in step 900 as before.

(43) In contrast, if the index of the file is registered with the WORM group, change/deletion is rejected in step 1000, and an error is returned.

(44) Addition of a file/directory to the directory is permitted irrespective of a group with which the directory is registered.

(45) A change in directory name and deletion of a directory are permitted if the index of the directory is registered with the R/W group as before.

(46) If the index of the directory is registered with the WORM group, a change of the directory name and deletion of the directory itself are rejected, and an error is returned.

(47) Application of the present invention allows a WORM file system to be constructed without adding new information to the index.

(48) Assuming that 400,000,000 files are stored in a tape medium, the volume of the indices can be reduced by 6 GB, and the time required to mount or unmount the tape medium to or from the file system can be reduced by 24 seconds, as compared with the related art, as described in Background Art.

(49) An embodiment of the present invention has been described on the basis of the LTFS.

(50) However, it is apparent to those skilled in the art that the present invention can be applied not only to the LTFS but also to any file system.

(51) The present invention can be embodied not only as the category of a method but also as a computer program for implementing the method.

(52) FIG. 7 is a matrix showing the mutual relationship between file type and medium type according to an embodiment of the present invention.