[comp.sys.sun] More than one tar file on streamer

ji@uunet.uu.net (John Ioannidis - Altair) (03/07/89)

In article <408@taeva.UUCP> unido!taeva!hans@uunet.uu.net (Hans von Kleist-Retzow) writes:
>I want to write more than one tar file onto a streamer tape. Therefore I
>write the first file as usual. Then I forward one file with the 'mt'
>command. Now I want to write to /dev/nrst0. But it is not possible.

There was a bug in 4.0 (which was fixed in 4.0.1), that required you to
rewind the tape, then fsf the appropriate number of files, in order to get
to the next file on tape. (that's why it takes forever to install 4.0 from
tape -- you rewind and then fsf for every single file).

If you still have 4.0 and don't want to update, you'll have to do just
that; rewind, then fsf one more file. Otherwize, the following worked just
fine on my machine (3/60, shoebox etc, SunOS 4.0_Export rel 4.0.1):

	walkuere$ mt -f /dev/nrst8 rew		# rewind the tape
	walkuere$ tar cvf /dev/nrst8 foo	# create one tar file
	a foo 1 blocks

	walkuere$ tar cvf /dev/nrst8 bar	# create another tar file
	a bar 1 blocks

	walkuere$ mt -f /dev/nrst8 rew		# rewind again
	walkuere$ tar tvf /dev/nrst8		# see what's in the 1st file
	rw-r--r--  0/0      376 Feb 23 18:27 1989 foo

	walkuere$ mt -f /dev/nrst8 fsf 1	# forward one file
	walkuere$ tar tvf /dev/nrst8		# see what's in the second
	rwxr-xr-x  0/0      131 Feb 23 18:27 1989 bar

(This of course works for much larger files, also!)

If you don't fsf 1 after the first tar t or tar x, the tape will go back
to the beginning of the current `file' and read it again. (Thus, if you
tar tvf /dev/nrst8 again, you'll get the file with `bar').  This is not
quite the way tar worked under older releases, (or at least 4.[23]bsd on a
vax), where if you did a tar right after a successful tar, you'd get back
a message saying something to the effect of `bad blocksize=0', but would
go past the EOF mark, ready to read the next file.

In-Real-Life: John Ioannidis
E-Mail-To: <ji@cs.columbia.edu> (preferred), or <ji@walkuere.altair.fr>
P-Mail-To: GIP-Altair, Dom de Voluceau BP105, Rocquencourt 78153 Le Chesnay, FR
V-Mail-To: +33 1 39635227, +33 1 39635417

chris@uunet.uu.net (Chris Brown) (03/08/89)

In response to Hans von Kleist-Retzow's question in v7n165, the following
command sequence will do the job:

	tar cf /dev/nrst8 files ...
	mt -f /dev/rst8 rew
	mt -f /dev/nrst8 fsf 1       <- You MUST use nrst8 here
	tar cf /dev/nrst8 files ...  <- And here too
	mt -f /dev/rst8 rew
	mt -f /dev/nrst8 fsf 2
	tar cf /dev/nrst8 files ...

and so on ...

One would imagine that a series of "tar cf /dev/nrst8 ..." commands would
work but I have not reliably been able to space forward to later files on
tapes written this way.

Chris Brown, A.I. Vision Research Unit, Sheffield University 
(chris@aivru.sheffield.ac.uk)

ralph@laas.laas.fr (Ralph P. Sobek) (04/05/89)

mcvax!aivru.sheffield.ac.uk!chris@uunet.uu.net (Chris Brown) writes:
> 
> One would imagine that a series of "tar cf /dev/nrst8 ..." commands would
> work but I have not reliably been able to space forward to later files on
> tapes written this way.

But they do work, for me!  I have a script which builds me a tar cassette
with only "tar cf /dev/nrst8 ..." and "cd" commands.  I have since been
able to extract from various positions on the tape.  This is under SunOS
3.5.  While getting this going, I did find out something, though.  If one
of the tar jobs aborted, there was a non negligible probability that the
next image would either be corrupted, or rst0 would complain with a
message that we never found in the documentation.  It seemed to create a
bad spot, and the only solution, that I found, was "mt -f /dev/rst8
erase"!!  REALLY!

-- 
Ralph P. Sobek			  Disclaimer: The above ruminations are my own.
ralph@laas.laas.fr			   Addresses are ordered by importance.
ralph@laas.uucp, or ...!uunet!mcvax!laas!ralph		If all else fails, try:
SOBEK@FRMOP11.BITNET				      sobek@eclair.Berkeley.EDU