Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!pyramid!prls!mips!dce
From: dce@mips.UUCP (David Elliott)
Newsgroups: comp.unix.wizards
Subject: Re: Has tar r ever worked?  For anybody?
Keywords: tar driver streamers
Message-ID: <1085@quacky.UUCP>
Date: 10 Dec 87 17:57:51 GMT
References: <1344@saturn.ucsc.edu> <22121@ucbvax.BERKELEY.EDU>
Reply-To: dce@quacky.UUCP (David Elliott)
Organization: MIPS Computer Systems, Sunnyvale, CA
Lines: 40

In article <22121@ucbvax.BERKELEY.EDU> bostic@ucbvax.BERKELEY.EDU (Keith Bostic) writes:
>In article <1344@saturn.ucsc.edu>, haynes@ucscc.UCSC.EDU.ucsc.edu (99700000) writes:
>> Under 4.3BSD, has anybody ever been able to add files to an existing
>> tar tape with tar r?  When we try it the tape goes around and it 
>> appears to be doing something, but then when we tar t the files are
>> not there.
...
>In answer to your question, yes, "tar r" has been used under
>4.3BSD.

My experience is that it depends on the "tape" device involved and the
driver.

If it is a regular file, it works. If it is a pipe, it can't.

If it is a streaming tape (either QIC or 1/2"), it is generally not
possible, since positioning the tape is costly. In fact, some systems
(Tek 61XX, for example) want you to read and write big chunks (128K) to
avoid burning out the motor, and don't supply tape record backspace.

In any event, if the driver doesn't support record backspace or
backward seeks, you can't do the 'r'.

You need to understand that a tar tape (see tar(5)) ends with two zero
blocks followed by random data. In order to do the replace, tar has to
go to the end of the tape, backspace a record, rebuild the last record
with the new data in place, and then continue as though it was the
original 'tar' running.

Sadly, no tape format for Unix has been completely successful at
dealing with everything. Tar doesn't handle long file names or multiple
volumes. Cpio doesn't handle volumes out of order and can't be ported
easily to systems with long inode or device numbers. Dump is for
filesystems. Nobody deals with adding to the end of a tape by simple
concatenation.

I think that whoever comes up with something to handle all of these
problems and can get people to use it will deserve a lot of gratitude.
-- 
David Elliott		dce@mips.com  or  {ames,decwrl,prls}!mips!dce