Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sdchema.UUCP Path: utzoo!linus!philabs!sdcsvax!sdchema!donn From: donn@sdchema.UUCP Newsgroups: net.unix-wizards Subject: Re: need fault-tolerant cpio Message-ID: <622@sdchema.UUCP> Date: Fri, 8-Jul-83 08:23:10 EDT Article-I.D.: sdchema.622 Posted: Fri Jul 8 08:23:10 1983 Date-Received: Sat, 9-Jul-83 13:50:13 EDT References: <115@ihu1e.UUCP> Organization: U.C. San Diego, Chemistry Dept. Administration Lines: 42 Does anyone out there have a "fault tolerant" cpio ??? I have a cpio tape from 3 years ago written on an 11/70 with a couple of bad spots - can any of the files be recovered? This can be done with the 4.1 BSD fault-tolerant 'tar' I sent out on the net some time ago, believe it or not. The tape must have records that are a multiple of 512 bytes in size and less than 10240 bytes long, though -- I don't think this is a problem with cpio tapes. The trick is to realize that the fault-tolerant tar has a 'junk' mode that lets you collect data off the tape even if there is no valid 'tar' checksum, and it ignores parity and other soft errors. This strategy will fail only if by some miracle there is a valid 'tar' tape header somewhere on the tape, in which case the 'tar' program will attempt to 'resynchronize'. A simple patch to the source code prevents this behavior, however... Some words of advice: I have found that parity errors on old tapes are often due to little bits of cruft on the tape, and after a few passes through the tape drive the bad spots sometimes magically disappear. Sometimes. Some systems have a 'dd' parameter called 'conv=noerror' which will repeatedly try to read a bad block and skip it if this does not succeed in making the error go away. This leads to 'gaps' in the output file but sometimes this doesn't manage to damage anything useful. My experience has been that a parity error hardly ever hurts very much data, so the fault-tolerant 'tar' simply copies what it gets and tells the user that it is suspicious. Since the tape DMAs directly into the user's buffer on 4.1 BSD, plus there is a way of finding out what kind of error occurred on the tape read, you can determine that there is a usable buffer's worth of data even though the 'read' on the tape device returned -1... By the way, did anyone who tried the fault-tolerant 'tar' find problems with occasionally truncated files? There was an off-by-one bug in it that I fixed at some point in the past but I can't remember whether I made the fix before or after posting... Oh well. Donn Seeley UCSD Chemistry Dept. RRCF ucbvax!sdcsvax!sdchema!donn (619) 452-4016 sdamos!donn@nprdc