(12) United States Patent (10) Patent No.: US 6,208,999 B1 Spilo Et Al
Total Page:16
File Type:pdf, Size:1020Kb
USOO6208999B1 (12) United States Patent (10) Patent No.: US 6,208,999 B1 Spilo et al. (45) Date of Patent: Mar. 27, 2001 (54) RECOVERABLE COMPUTER FILE SYSTEM 5,488,702 * 1/1996 Byers et al. ......................... 395/186 WITH A SIGNATURE AREA CONTAINING 5,675,767 * 10/1997 Baird et al. .......................... 711/156 FILE INTEGRITY INFORMATION LOCATED OTHER PUBLICATIONS IN THE STORAGE BLOCKS IBM Technical Disclosure Bulletin, 39(1):263-264, Jan. 1, (75) Inventors: Michael L. Spilo; Jonathan A. Daub, 1996. both of New York, NY (US) * cited by examiner (73) Assignee: Network Associates, Inc., Santa Clara, Primary Examiner Thomas Black CA (US) ASSistant Examiner John C. Loomis - 0 (74) Attorney, Agent, or Firm-Darby & Darby (*) Notice: Subject to any disclaimer, the term of this patent is extended or adjusted under 35 (57) ABSTRACT U.S.C. 154(b) by 0 days. A file System for data file Storage on a block Storage device includes signature information embedded within each block (21) Appl. No.: 08/764,309 allocated to a data file. Such Signature information includes (22) Filed: Dec. 12, 1996 a file identification number, a Sequence number within the file, and optional file type information. The Signature infor (51) Int. CI.7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - G06F 17/30 mation is used to reconStruct files O the block Storage (52) U.S. Cl. ............................................. 707/202; 707/205 device in the event of damage to data files or critical System (58) Field of Search ..................................... 707/202, 205; areas on the device. The directory structure for the file 395/182.13, 182.18 System is maintained as a Self-contained flat database, Stored as a B-tree for expedited Searching, including full hierar (56) References Cited chical pathnames for each directory entry, thereby enhanc ing the ability to recover files in a low level of the directory U.S. PATENT DOCUMENTS hierarchy when a middle level has been damaged. 4.941,059 7/1990 Grant ................................... 711/156 5,083.264 1/1992 Platteter et al. 27 Claims, 10 Drawing Sheets 120 Begin 98 File AlloCotton 18O able Domaged 82 Check No Signature Reconstruct File Allocation Table Yes Add Block Wolid to Doto Structure Signature? Finished 188 Blocks Remon? Yes insert Alert User Empty Blocks Recreate/Repair 190 Directory Structure Files Missing Blocks U.S. Patent US 6,208,999 B1 U.S. Patent Mar. 27, 2001 Sheet 2 of 10 09 V CD 1 U.S. Patent Mar. 27, 2001 Sheet 3 of 10 US 6,208,999 B1 g S S. U.S. Patent Mar. 27, 2001 Sheet 4 of 10 US 6,208,999 B1 FIG. 5 80 ReOd Top Level Directory 82 SeOrch Directory 86 Return Success Code 94 Return ReOd Next More Foilure Directory Block AVoloble? Code U.S. Patent Mar. 27, 2001 Sheet 5 of 10 US 6,208,999 B1 Perform 100 F G. 6 File Search 102 Yes Return 104 Foilure Code No Note Ocotion 106 for F tlenome Within B-Tree Give Directory Entry 114 Proper Filenome and File Location AlloCote 108 File identificotion Number 116 Write to AlloCoted Space 110 AlloCote Spoce 118 Bolonce B-Tree Creote 112 Directory Entry Return 119 Success Code U.S. Patent Mar. 27, 2001 Sheet 6 of 10 US 6,208,999 B1 F. G. 7 120 Perform File SeOrch 122 Desired Yes Return 124 Directory Foilure Found? Code No Note LOCotion 126 for Directory Within B-Tree Create 128 132 Directory Bolonce Entry B-Tree Give Directory Entry 130 Return 134 Proper Directory Success Nome Code U.S. Patent Mar. 27, 2001 Sheet 7 of 10 US 6,208,999 B1 140 Perform File Search F G. 8 142 144 Desired No Return File Follure Found? Code Yes 146 Toke Block LOCotion from Directory Entry 148 152 Erose Erose File Blocks city 154 De-AlloCote 150 Bolonce SpOce in File B-Tree AlloCotton Toble 156 Return Success Code U.S. Patent Mar. 27, 2001 Sheet 8 of 10 US 6,208,999 B1 F. G. 9 160 Perform File Seorch 164 Desired Return File Failure Found? Code Toke Block LoCotion from Directory Entry 168 ReOd Block from File 172 Return Success Code U.S. Patent Mar. 27, 2001 Sheet 9 of 10 US 6,208,999 B1 FIG. OA 182 Check Signoture Add Block Wolid to Doto Structure Signoture? Recreate/Repoir 190 Directory Structure Files Missing Blocks? U.S. Patent Mar. 27, 2001 Sheet 10 of 10 US 6,208,999 B1 FIG. OB 198 File AlloCotion Noble Domoged? Reconstruct File AlloCotion Toble Finished Insert Alert User Empty Blocks US 6,208,999 B1 1 2 RECOVERABLE COMPUTER FILE SYSTEM The data Stored on a block Storage device can be damaged WITH A SIGNATURE AREA CONTAINING in a number of ways. An errant computer program can FILE INTEGRITY INFORMATION LOCATED accidentally write information to one or more previously IN THE STORAGE BLOCKS allocated blockS. A power aberration can cause a write operation to be only partially completed, or can cause a computer to write inaccurate data. Moreover, mechanical or The invention relates to a method and System for data electronic failure of a block Storage device is possible. image and retrieval on digital computer devices, and more Magnetic Storage devices are particularly Susceptible to particularly to a file System for block Storage devices environmental factors, Such as temperature and electromag whereby certain data errors can be corrected and lost or netic fields. damaged data can be recovered. While certain known StepS can be taken to prevent many BACKGROUND OF THE INVENTION causes of failure, Some errors are considered to be inevi table. Accordingly, a need exists to be able to repair damage Block Storage devices, Such as disk drives and tape drives, when it occurs. are commonly used for Storage of computer data. One format for the Storage of data on block Storage Block Storage devices typically Store information in 15 devices is known as the “FAT” (“File Allocation Table”) file evenly-sized portions, or “blocks.” If a data file is smaller system. The best-known implementation of a FAT system is than a single block, then a whole block is used to Store the used on PC-compatible computers by Microsoft MS-DOS data, and the remainder of the block is unused. If a data file and Microsoft Windows 95, although other computers and is larger than a block, then two or more blocks, which often operating Systems use Similar Systems. On a disk using the are not contiguous, can be used to Store the data. Again, FAT file System, the System area contains a "root,” or highest blocks containing unused space are often allocated to a file level directory containing information on other directories in this Storage Scheme. Block Storage devices typically use and data files on the disk. The root directory can have a a Writable medium, Such as a magnetic or optical medium, number of directory entries, each of which contains infor to Store the computer data, although other forms of elec mation on a single directory or data file, including its name 25 and a number corresponding to where the file begins on the tronic memory can also be used. disk. Each individual block on the disk has a unique iden A Single disk or tape device usually has a capacity of tification number for this purpose. many blocks, often into the millions, allowing many data The system area of a FAT disk also includes a file files to be stored. In order to make access to files Stored on allocation table, which is an array of block numbers or a block Storage device more efficient, these files can be "pointers' to locations on the disk holding data belonging to organized into groups known as "directories.” In this way, data files. The file allocation table has one entry, capable of data files having Similar content, usage, or characteristics holding a number, for each block on the disk. If the block can be grouped together for a user's convenience. Directo corresponding to an entry in the file allocation table is not ries are actually data files that contain information Specify allocated to any directory or data file, then the entry contains ing where data files are Stored on the block Storage device. 35 a unique numeric identifier Specifying that condition. If the They can often be hierarchical; in other words, directory block is allocated, then the entry contains a number speci files can point to other directory files, which in turn point to fying which block is the next one to Store a Successive data files. The location of a file within a directory hierarchy portion of the file in question. If no more blocks are needed can be specified by means of a “pathname” to the file, which to Store the file, another unique numeric identifier is used to indicates the name of each directory traversed as well as the 40 Specify that condition. filename. Accordingly, under the FAT file system, files need not be In addition to data files and directory files, block Storage Stored in consecutive blocks on the disk. Consider, as an devices usually contain a Small amount of additional infor example, a disk having 10,000 blocks and one desired file, mation in a “system area.” This additional information two blocks long. Assume that the first portion of the file is Specifies, among other things, what Space on the device is 45 stored in block number 2,395 and the second portion is used and what is available for use. When a computer SeekS Stored in block number 6,911.