Subject: Problem with tape unit

From: [email-masked] (Joe Vasher)

I'm having a problem with a tape unit I just bought, I'm not sure if 
it's a bug, or configuration problem.

        I compiled my own kernel and added the following:

tape        st0        at gvp11scsi slave 2

        now when I try to use the tape I use the following command:

tar czvpf /dev/rst0 /etc/

        Which will produce the following errors while packing the files (which 
it does with limited succes.

at the start:

st: stat-0, blklen=512

displays a couple file names then prints

Feb 5 04:41:26 cquest /vmunix: st: stat=0, blklen=512
Feb 5 04:41:26 cquest /vmunix: st: stat=0, blklen=512

displays the rest of the files being packed then at the end displayss these 
errors:

st0: I/O not block aligned 512/7798
st0: ILLEGAL REQUEST

Feb 5 04:35:27 cquest /vmunix: st0: I/O not block aligned 512/7798
tar (child): can't write to /dev/rst0: Input/Output error
Feb 5 04:35:28 cquest /vmunix: st0: ILLEGAL REQUEST

Then when I try to unpack using the following, I find myself missing some 
files directorys and symlinks:

tar xzvpf /dev/rst0

Perhaps this is a bug, but it could be a configuration problem or something I 
need to do different. I just bought the tape drive and have a 7 day trial to 
make sure it works right (it's used) and could really use the help on this. 
It's a gvp 150 meg wangtech tape drive internal which I have hooked up the 
third on a line with a 240 meg HD and a 42 meg hd.

If you can offer suggestions to try please do. Thanks!

--
<======================================================================>
|    Joe Vasher               Internet: [email-masked] or       |
|    ComQuest BBS             UUCP:     heifetz!mbsun!cquest!jvasher   |
|    (313)397-5047            FIDO:     Joe Vasher>1:2410/403.0        |
|                      Thanks for flying Xcel                          |
<======================================================================>

---

From: [email-masked] (Michael L. Hitch)

> it's a bug, or configuration problem.

  It neither - it's how you are using it.

> Feb 5 04:41:26 cquest /vmunix: st: stat=0, blklen=512

  I think this is syslog echoing the previous output to the console.

> If you can offer suggestions to try please do. Thanks!

  The problem is that the Wangtek tape drive only works with fixed-length
blocks of 512 bytes.  By specifying the 'z' option on tar, the tar output
is passed through compress.  The output of compress will not be a multiple
of 512 bytes, so when the tape driver receives a buffer that is not a
multiple of 512 bytes, it will generate the "I/O not block aligned" message:
the first number is the block size, the second number is the size of the
buffer.  The tape driver will then force the I/O to generate an error by
clearing the fixed-length bit in the SCSI command, which will cause the
"illegal request" error.  This also means that that data (which is probably
the the last output from compress) will not get written to the tape, so will
be missing when you try to restore.

  To write to the tape correctly, you either need to remove the 'z' option
on tar (so that the output will be a multiple of 512 bytes), or you need
to pipe the tar output to dd and specify the block size on dd.  I don't
remember if dd will pad the data to a blocksize boundary by default, or
if you need to tell dd to pad it.

Michael

-- 
Michael L. Hitch			INTERNET:  [email-masked]
Computer Consultant			BITNET:  [email-masked]
Office of Systems and Computing Services
Montana State University	Bozeman, MT	USA