need fault-tolerant cpio

tom at rlgvax.UUCP tom at rlgvax.UUCP
Sat Jul 9 05:10:22 AEST 1983


I don't have a fault-tolerant cpio handy, but here are some quick-and-dirty
alternatives:

1)	Cpio needn't read a tape.  If you have ANY utility to read in
a tape and skip over bad spots, use it to read the tape into a file.
It is important that SOMETHING be put in the file in place of the
bad blocks -- all nulls will do, but DON'T merely skip the bad blocks
and make the file shorter.  Then try using cpio to read the file.
If you are lucky, the bad spots only occurred within one of the
archived files.  That file will be corrupted, but the rest will
hopefully be extracted OK.

2)	If that doesn't work, a little knowledge of cpio may help.
Each file in the archive is preceded by a header containing such little
tidbits as the name, size, permissions, etc. of the file.  The very first
word of the header is the "magic number" 070707.  So here's what you do:
Again, read in the file from tape somehow or another.  This time its not
important that you supply something in place of the bad blocks; skipping
them will do.  Then write a little program that reads the file and splits
it into separate files every time it sees the magic number.  This gives
you your files, but you will have to manually go in and remove
the rest of the header information from the front of the file.  Be careful,
its not likely to be ASCII.

So now your only problem is finding something that will read past a bad
spot on the tape.  Hope your UNIX version allows it.  Otherwise you'd better
look around for another system (UNIX or otherwise) that does.

- Tom Beres
{sesimo, allegra, brl-bmd, mcnc, we13}!rlgvax!tom



More information about the Comp.unix.wizards mailing list