[comp.sys.sun] 1/4 inch cartridge tape drives & tar

chuck@trantor.harris-atd.com (Chuck Musciano) (02/01/89)

> is it true that there is no way to append files to a cartridge tape using
> tar?  this is what the docs appear to say.  please tell me it isn't so.  

     Say it isn't so, Joe...

>      r  Write the named files on the end of  the  tarfile.  Note
>         that this option does not work with quarter-inch archive
>         tapes.

Not only do the docs "appear" to say this, they actually do!  And they
mean it!  You can't!

Chuck Musciano
Advanced Technology Department
Harris Corporation
(407) 727-6131
ARPA: chuck@trantor.harris-atd.com

aad@stepstone.com (Anthony A. Datri) (02/01/89)

You can't append *to files*, like with "tar r", but you certainly can put
multiple files on the same tape, using the nrst* non-rewinding device.

Anthony A. Datri @SysAdmin(Stepstone Corporation) aad@stepstone.com stpstn!aad

jenkinsm@uv4.eglin.af.mil (MICHAEL A JENKINS) (02/09/89)

You can't use the r option of tar with cartridge tape tarfiles, BUT you
can use it with disk tarfiles.  Simply copy the tarfile from the tape to
disk, add the new files, and copy the tarfile back to the tape.  Here are
a couple of examples:


	EXAMPLE 1: Tape contains a single tarfile.

	mt -f /dev/rst0 rewind			# rewind tape
	cp /dev/rst0 disk.tar			# get tarfile
	tar rvf disk.tar filea fileb filec	# add other files
	cp disk.tar /dev/rst0			# put tarfile


	EXAMPLE 2: Tape contains 5 files with file #3
			being the tarfile of interest.

	mt -f /dev/rst0 rewind			# rewind tape
	mt -f /dev/nrst0 fsf 2			# skip over first two files
	cp /dev/rst0 disk.tar			# get tarfile ...
						# ... and the tape rewinds
	tar rvf disk.tar filea fileb filec	# add other files
	mt -f /dev/nrst0 fsf 5			# skip to end of tape
	cp disk.tar /dev/rst0			# put tarfile

It's as simple as cp!  Hope this helps.

Michael A. Jenkins
ARPA: jenkinsm@eglin-vax.arpa

jes@mbio.med.upenn.edu (Joe Smith) (02/14/89)

> You can't append *to files*, like with "tar r", but you certainly can put
> multiple files on the same tape, using the nrst* non-rewinding device.

Fine, but what if you *forget* how many files are on the tape (ok, lose
the paper it's written down on :-)), or worse yet, replace a tar with a
new version thats slightly larger?  Is there a mt command to skip to empty
tape?  Seems a risky way to archive things to me.

jes@mbio.med.upenn.edu

University of Pennsylvania
Dept. of Biochemistry and Biophysics
233 Anatomy-Chemistry
Philadelphia, PA 19104-6059
(215) 898-8348

stpeters@uunet.uu.net (02/16/89)

chuck@trantor.harris-atd.com (Chuck Musciano) writes:
>      r  Write the named files on the end of  the  tarfile.  Note
>         that this option does not work with quarter-inch archive
>         tapes.
>
>Not only do the docs "appear" to say this, they actually do!  And they
>mean it!  You can't!

While you can't append to a tarfile, the question was phrased about
appending to a tape.  That you can do, by using the /dev/nrst{0,8} devices
and mt (to skip the first tarfile) as well as tar.  That may or may not
meet the need that caused the question.

Dick St.Peters                        
GE Corporate R&D, Schenectady, NY
stpeters@ge-crd.arpa              
uunet!steinmetz!stpeters

pvo1478@oce.orst.edu (Paul V. O'Neill) (02/23/89)

>Is there a mt command to skip to empty tape?  Seems a risky way
>to archive things to me.

Hmmmm.... don't know why, but this doesn't work:
__________

yourhost% mt rewind
yourhost% mt fsf 1000
/dev/nrst8 fsf 1000 failed: I/O error
yourhost% mt status
st0:  warning, using alternate tape density
SCSI tape drive:
   sense key= 0x8   residual= 0   retries= 0
   file no= 0   block no= 0
__________

BUT, this does:
__________

yourhost% mt rewind
yourhost% mt fsf 1    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
yourhost% mt fsf 1000
yourhost% tar cvf /dev/nrst8 .cshrc
a .cshrc 16 blocks
yourhost% mt rewind
yourhost% mt fsf 24          (I knew there were already 24 files on this tape)
yourhost% tar xvf /dev/nrst8
x .cshrc, 7829 bytes, 16 tape blocks  (Sure enough--appended to end of tape)
__________

(4/110, SunOS 4.0)

Paul O'Neill                 pvo@oce.orst.edu
Coastal Imaging Lab
OSU--Oceanography
Corvallis, OR  97331         503-754-3251