Accessing a VAX tape drive from a S

kai at uicsrd.csrd.uiuc.edu kai at uicsrd.csrd.uiuc.edu
Tue Sep 6 04:07:00 AEST 1988


> When writing a local tape, each write() call produces one record.

Not true when a blocking factor > 1 is used.  Each write just adds a little
to a buffer, and when the buffer is full, THEN one physical record is
actually produced.

> When writing through the network like this, this is not guaranteed,
> and in practice will probably not be so.

The best way I've found to write through the network is to use fixed size
blocks.  Make sure the program that is reading from the network knows the
correct blocksize and doesn't assume it will all show up after one single
read.  Multiple reads may (or may not) be neccessary

Fortunately "dd" can do this:
	dd bs=20b of=/dev/rmt8

The "tar" program has an option (-B) to force input/output blocking to 20 "so
that tar can work across a communications channel where the blocking may not
be maintained."


> Experiment first.  For example, put a tar tape on the drive and do
>	tapehost% dd if=/dev/rmt12 of=/tmp/foo
>	tapehost% rcp /tmp/foo otherhost:/tmp/foo
>then change tapes (put a scratch tape on) and do
>	otherhost% rsh tapehost dd of=/dev/rmt12 < /tmp/foo
>Then run tar on the resulting tape and notice the complaints.

dd's default input and output blocksizes are 512 bytes.  Tar's default
blocksize for writing is 10240 bytes.  Try:

	tapehost% dd bs=20b if=/dev/rmt12 of=/tmp/foo
	tapehost% rcp /tmp/foo otherhost:/tmp/foo
	otherhost% rsh tapehost dd bs=20b of=/dev/rmt12 < /tmp/foo

and dd will make sure it reads 10240 bytes (tar's default blocksize) each
time.

Patrick Wolfe  (pwolfe at kai.com,  kailand!pwolfe)



More information about the Comp.unix.wizards mailing list