13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

File recovery 209tape 6. Whenever we use tape t , we dump all files that were modified since the last timewe used tape t or any tape with a higher number.We use the lower-numbered tapes fairly frequently, so they don’t have to storevery many files. The higher-numbered tapes are used much more rarely, so they holdmany more files. Tape 7 is written only every 128 days. If we wish to archive fileslonger than that, we just need to buy some more tapes.This pattern of tape use is known as the ‘‘ruler function’’ because its graph lookslike the pattern of marks on a ruler. Figure 6.9 shows which tape we use each day bydrawing a vertical bar whose height tells the number of the tape to use. If a file is createdon day c and deleted on day d , a dump version will be saved substantially after day d ,and the length of time it is saved depends on d − c (as well as the exact values of c andd ). For example, a file created on day 5 and deleted on day 8 has existed for 3 days.During that time, it was saved on tapes 0 (day 5), 1 (day 6), and 0 (day 7). Tape 1 willnot be reused until day 10, so the file is saved 2 extra days. A 3-day file created on day 6and deleted on day 9 has been saved on tape 3 (day 8), which will not be reused until day24.4.2 Backup files and versionsMost computer installations hire operators to dump tapes according to a fixed schedule;these dumps form the last defense against lost information. There are other defenses thatare worth mentioning. First, backup files that duplicate working files are a standardtechnique. If the user (or the user’s program) accidentally deletes a working file, itsbackup can still be used. Some programs (particularly text editors) automatically save anold version of the file they are working on under a name derived from the file’s name.For example, if the editor is working on file slide1.text, it might save the originalcontents under the name slide1.text.backup.Backup files can be generalized to file versions. Whenever a file is opened forwriting, a new version is created that is initialized to the data in the previous version ofthe file. The new version is opened, and the old version is left alone. Modifications tothis version do not hurt the previous version. A wide spectrum of support is available forFigure 6.9 The ruler function

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!