[net.unix] reading TAR from VMS

ramin@rtgvax.UUCP (Pantagruel) (08/26/86)

Dammit dammit dammit!

I should've asked for it while it was flying past... I did see the
request a few months back for a program to read TAR format tapes from
VMS, but thought "oh well... who needs that." 

Well if anyone has one, I sure would appreciate getting a copy of
it... Our unix tape drive is about to be shipped to the funny farm and
the vms machines are getting all the new model ones... I looked in
mod.sources listings but alas... I'll also check the decus tapes, but
I doubt I'll have much luck.

Thanks much...

ramin

-- 
=--------------------------------------=-------------------------------------=
: alias: ramin firoozye'               :   USps: Systems Control Inc.        :
: uucp: ...!shasta \                   :         1801 Page Mill Road         :
:       ...!lll-lcc \                  :         Palo Alto, CA  94303        :
:       ...!ihnp4    \...!rtgvax!ramin :   ^G:   (415) 494-1165 x-1777       :
=--------------------------------------=-------------------------------------=

bhoward@funvax.UUCP (Bruce Howard) (08/28/86)

> Dammit dammit dammit!
> 
> I should've asked for it while it was flying past... I did see the
> request a few months back for a program to read TAR format tapes from
> VMS, but thought "oh well... who needs that." 
> 
> Well if anyone has one, I sure would appreciate getting a copy of
> it... Our unix tape drive is about to be shipped to the funny farm and
> the vms machines are getting all the new model ones... I looked in
> mod.sources listings but alas... I'll also check the decus tapes, but
> I doubt I'll have much luck.

Gosh!  And I thought we were the only people in the world
with a screwball set up -- we have a network of VAXen that
speak Internet and DECnet to each other.  The only available
tape drive unfortunately lies on the downstairs VAX 8600.
In the long term, the BEST solution will be to obtain a
TK50 or TU80? (something like that) tape drive.  Anyways,
please credit most of the following solution to Chris Lent
at ...philabs!phri!cooper!chris.

This method has been successfully used to read in our
Berkeley distribution tapes.  Additionally, I have managed
to write what appear to be UNIX format tapes though I have
not been able to test them on a tape drive attached to a UNIX
host.

First you must have an fdl file created that describes the
file we are pulling off the UNIX format tape.  I have not 
had the time nor the desire to fully understand its format
but it seems to simply say that whatever it is we pull off
the tape should be placed in a sequential file with no strange
attributes:

--- cut here ---
IDENT	"16-NOV-1985 09:34:31	VAX/VMS ANALYZE/RMS_FILE Utility"

SYSTEM
	SOURCE                  VAX/VMS

FILE
	ALLOCATION              13
	BEST_TRY_CONTIGUOUS     no
	CLUSTER_SIZE            1
	CONTIGUOUS              no
	EXTENSION               0
	GLOBAL_BUFFER_COUNT     0
	NAME                    "dua2:[bhoward.vms]tar.exe"
	ORGANIZATION            sequential
	OWNER                   [647,24]        
	PROTECTION              (system:RWED, owner:RWED, group:RE, world:RE)

RECORD
	BLOCK_SPAN              yes
	CARRIAGE_CONTROL        none
	FORMAT                  fixed
	SIZE                    10240
--- cut here ---
The owner field should be defined to be the UIC of the account
which happens to be reading in the file.  I don't think that
which is defined in the NAME field is important, but you can
experiment or look it up in the VMS docs.  For purposes of
this explanation, I shall assume you have typed this into a
file named tarcvt.fdl

Once you have this fdl typed in, the following steps will read
a file off of the UNIX tape into a VMS file which can then be
transported to UNIX via ethernet or kermit.  

$ mount mua0: /foreign/block=10240
(mua0: happens to be the name of our primary tape drive.
 10240 is the block size on our berkeley tapes.  Set as
 is appropriate for your tape.)
$ convert /fdl=tarcvt.fdl mua0: nameoftarfile
(this reads in the first file on the tape into a file on
 vms named nameoftarfile)
$ dismount mua0:

Sometimes, as in the case of the berkeley distribution, you
have multiple files on a tape.  One of ours had three sections.
You can use the set mag command to move between files.  For
example, we wanted to pull off the ingress database which I
believe was the third file of one tape.  To do this we typed:

$ mount mua0: /foreign/block=10240
$ set mag /skip=files:2
$ convert /fdl=tarcvt.fdl mua0: ingres.tar
$ dismount mua0:

Also useful, is set mag /rewind which rewinds without dismounting
the tape.

To write a tape file is almost the same as reading.  You just
switch the order around on the files, that is:

$ mount mua0: /foreign/block=10240
$ convert /fdl=tarcvt.fdl usrbackup.tar mua0:
$ convert /fdl=tarcvt.fdl srcbackup.dump mua0:
$ dismount mua0:

which places two files onto the tape.  I have NOT confirmed
that these tapes are readable by UNIX hosts.

Here are a few tricks I've developed to read tar files across
DECnet.  For example, to pull off a directory name ./etc/getty
from a tar file that has been placed onto VMS, from UNIX type:

% dcp -i mother/bhoward::'[.archive]src.tar' - | tar -xvf - ./etc/getty
Password for mother/bhoward::? (type password)
(watch it verbosely untar)

This can also be done with the cpio and dump commands though
I don't believe it works with dump in interactive mode.

I think this is slightly incomplete, but it should get you started. 
I plan of writing a more complete paper on these and other techniques
our unique (silly) hardware situation has forced us to develop. 
Please feel free to ask me questions via mail.

			Cheers!
			Bruce

-- 

		 ---------------------------------
...decvax!ittatc!funvax!bhoward  Bruce Howard @ Fairfield University
...ihnp4!itivax!funvax!bhoward   Located in Scenic Fairfield, CT 06430
		 ---------------------------------

H_Eidnes%vax.runit.unit.uninett@NTA-VAX.arpa (H}vard Eidnes) (09/01/86)

Commenting on note in Info-Unix Digest V2#202:

We even went one step further than just copying the whole tape --
the reason being that we have accounts with limited disk space on
"our" VMS machine (the only "decent" machine here with a 1/2" tape
drive). A good friend of mine wrote a program to selectively read
parts of a TAR tape to a TAR-format disk file on our VMS machine.
The program also has code to do extraction on VMS, but that part of
it hasn't been tested much.

The program is <600 lines VMS Pascal. If there is enough interest,
I can send it (maybe to Unix-Sources@...?).

H}vard Eidnes   (or TeXish: H\aa vard Eidnes)
Norwegian Institute of Technology, Division of Computer Science.

<generic disclaimer>