[comp.unix.internals] How to get past end of cpio archive on tape

news@bjm.wimsey.bc.ca (News Login) (12/12/90)

Hi NET,
	
	I have this backup which I accidentally wrote a cpio archive over.  However
the cpio archive is only 20 megabytes and therefore 1/3 of the tape.  What I
really want to do is get past the cpio archive and just retreive the rest of
the tape into a file and I will fix the remaining tar file by hand.  My 
question is (drum roll please)
how do get past the EOF marker at the end of the cpio?  I've tried dd, cat, 
evmt (a utility which comes with ESIX [which I'm now running] which is similar
to sco xenix's 'tape' utility) which allows me to get to the next eof but 
not past
it.  I don't really care how much past the eof I go (.5 to even 1 meg if I have
to).  I think what I mostly overwrote was the /bin /usr/bin stuff. 

	Any ideas would be much appreciated.

kittlitz@mips2.cr.bull.com (Ned Kittlitz) (12/12/90)

In article <1990Dec12.050414.15575@bjm.wimsey.bc.ca> news@bjm.wimsey.bc.ca (News Login) writes:
>Hi NET,
>	
>	I have this backup which I accidentally wrote a cpio archive over.
>However, the cpio archive is only 20 megabytes and therefore 1/3 of the tape.

You don't say so explicitly, but by the process of multiplication, 
I am going to assume that you are talking about a 60MB 1/4 inch cartridge
tape. If so, several ravens which I have at hand quoth "nevermore".

From the Archive Viper description of write: "QIC data can only
be written over erased tape; therefor, when the Viper drive
writes to track zero, the erase head is turned on to condition the
entire tape".

From the Wangtek OEM manual for 5099ES/5125ES/5150ES streaming 1/4 inch
tape cartridge drive: "Tape is erased automatically while writing
track zero."

----------
E. N. Kittlitz - consulting at Bull, and nothing more.
kittlitz@world.std.com or kittlitz@granite.cr.bull.com

dag@fciva.FRANKLIN.COM (Daniel A. Graifer) (12/14/90)

In article <1990Dec12.050414.15575@bjm.wimsey.bc.ca> news@bjm.wimsey.bc.ca (News Login) writes:
>	I have this backup which I accidentally wrote a cpio archive over.
>However, the cpio archive is only 20 megabytes and therefore 1/3 of the tape.

I think what you are asking here is 'How do I read beyond the end of the EOF
mark on the tape'.  The problem is that, when whichever process you use to
read past the first file closes the device, it automatically rewinds.  There
should be a different device (same major, different minor number) that
is explicitly no-rewind-on-close.  On my PRIME EXL (386 MultiBusII/SCSI, ATT
Unix Sys V 3.1.2), I have:
$ l /dev/rct
total 0
crw-rw-rw-   2 root     sys        1,160 Dec 13 12:19 c0d5
crw-rw-rw-   1 root     sys        1,164 Jun 27 10:56 c0d5n
crw-rw-rw-   1 root     sys        1,165 Feb 18  1989 c0d5w
$
Controller 0 (SCSI) device 5 (cartridge tape) no-rewind is the second device
here.  Once you've that device, use cpio or dd to read to the end of it, then
reopen the either the regular or the no-rewind device with dd to suck in the
data beyond the EOF mark.  Don't forget to rewind the tape after the last 
read, before you pull it from the drive!

Good luck
Dan

randyj@bcs800.UUCP (Randy Jarrett) (12/15/90)

In <1990Dec12.050414.15575@bjm.wimsey.bc.ca> news@bjm.wimsey.bc.ca (News Login) writes:

>Hi NET,
>	
>	I have this backup which I accidentally wrote a cpio archive over.  However
>the cpio archive is only 20 megabytes and therefore 1/3 of the tape.  What I
>really want to do is get past the cpio archive and just retreive the rest of
>the tape into a file and I will fix the remaining tar file by hand.  My 
>question is (drum roll please)
>how do get past the EOF marker at the end of the cpio?  I've tried dd, cat, 
>evmt (a utility which comes with ESIX [which I'm now running] which is similar
>to sco xenix's 'tape' utility) which allows me to get to the next eof but 
>not past
>it.  I don't really care how much past the eof I go (.5 to even 1 meg if I have
>to).  I think what I mostly overwrote was the /bin /usr/bin stuff. 


I have had a similar experence in the recent past. What I was able to do
was to read the first portion (your cpio) with the -ivtc option and using
the no-rewind device which will leave the tape sitting at the end of the
cpio section.  You can then continue on however you want to get the rest
of the tape.  In my case I used cpio with the 'k' option to skip bad sections
and start at the next valid header.  I don't know that tar has any such
options..  


Good luck


Randy Jarrett  WA4MEI              | US SNAIL: 2859 Paces Ferry Rd.
UUCP  ...!emory!bcs800!rsj         |           Suite 1000
PHONE +1 404 431 1200		   |           Atlanta, GA 30339