Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!mailrus!uwmcsd1!uxc!uxc.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!kai From: kai@uicsrd.csrd.uiuc.edu Newsgroups: comp.unix.wizards Subject: Re: Accessing a VAX tape drive from a S Message-ID: <43200035@uicsrd.csrd.uiuc.edu> Date: 5 Sep 88 18:07:00 GMT References: <711@auvax.UUCP> Lines: 41 Nf-ID: #R:auvax.UUCP:711:uicsrd.csrd.uiuc.edu:43200035:000:1573 Nf-From: uicsrd.csrd.uiuc.edu!kai Sep 5 13:07:00 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@kai.com, kailand!pwolfe)