Subject: Re: amanda
To: Aaron J. Grier <agrier@poofygoof.com>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 12/09/2006 09:43:47
--=-=-=
Content-Transfer-Encoding: quoted-printable
"Aaron J. Grier" <agrier@poofygoof.com> writes:
> /netbsd: st0: 65536-byte tape record too big for 32768-byte user buffer=20
What did amtapetype print?
> I was able to work around it by:
>
> $ mt -f /dev/nrst0 setblk 32768
> $ dd if=3D/dev/zero of=3D/dev/rst0 bs=3D32k count=3D10
> $ dd if=3D/dev/rst0 of=3D/dev/null bs=3D32k count=3D10
>
> and then amtapetype would work.
>
> I need to grovel the source code for amanda; I suspect that if
> amtapetype did the proper block size ioctl() before reading a tape
> label, things would work correctly with block sizes other than 32k.
amtapetype reads the tape to see if there's an amanda label, in order
to avoid writing on an in-use tape.
From=20your mail, it sounds like the tape you had in the drive had data
on it with 64k blocksize. Does this seem likely? If so, I'm not sure
setblk 32768 would help. From skimming the driver, it looks like it
will default to variable-length blocks.
I doubt it, but it may be that reads of blocks bigger than the user's
buffer are expected to work on other operating systems, returning the
first 32k, rather than failing. It sounds like the read failed; the
driver sets EIO. See src/sys/dev/scsipi/st.c line 2236.
So, amtapetype should have had a failed read, and decided that it
couldn't tell if the tape was an amanda tape, and tell you that you
have to use -o to overwrite the tape.
So I'm not sure what the right thing to do is. Perhaps amtapetype
should have a way to query the tape blocksize, or to use a really big
blocksize since short reads are ok.
--=-=-=
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)
iD8DBQFFesum+vesoDJhHiURAsp5AKCNvrvpvVHB9O7pbW8+VvygcdsRiwCdHLl9
guwo438nyVVURSYrtoQOEtc=
=HcQ+
-----END PGP SIGNATURE-----
--=-=-=--