Subject: Re: Tapeboot problem SOLUTION
To: None <tom@sdf.com>
From: Ian Dall <dall@HFRD.DSTO.GOV.AU>
List: port-sun3
Date: 12/11/1995 09:55:24
Tom Samplonius <tom@sdf.com> writes:
> On Thu, 7 Dec 1995 geoff@softy.softwords.bc.ca wrote:
>> > I can't make my Sun 3/60M boot a NetBSD-1.1 tape.
>> >
>> > I get this on boot up:
>> >
>> > >> NetBSD tapeboot [$Revision: 1.3 $]
>> > exec: short read
>> > tapeboot: 1: Input/output error
>> > tapeboot: segment? [1]
>>
>> Tom, I get the exact same error (also a Sun3/60). Let me know if you find a
>> solution to it....
> I found a solution that works for me.
> I gunzipped the netbsd-rd.gz and miniroot.gz files and then modified
> MakeBootTape to dd the raw files instead. Without the overhead of
> gunzipping on the fly, the tape drive ran almost continuously.
> I think maybe my tapedrive is starting to die, and doesn't position itself
> accurately, while stopping and starting during a write.
I doubt that is the cause. I had the same problem and I traced it to
dd and possibly the tape driver.
First, my tape drive/driver won't write partial blocks to the raw
device. This is reasonable (it is the *raw* device after all), but
other tape drivers might pad with nulls. Consider the command
gunzip < netbsd-rd.gz | dd bs=8k of=$T
due to the pipe, dd will get short reads, which it copies quite
happilly to the tape. If it is a qic tape, short writes don't matter
much so long as they are a multiple of 512 bytes, which I think they
will be in practice, except for the last read. The size of netbsd-rd,
is not it seems a multiple of 512 bytes, and the last bit gets lost.
In short, the bs=8k doesn't do much. This might be specific to the
version of dd, but I tried both GNU dd and netbsd dd. Adding conv=sync
doesn't help because that pads reads to 8k causing heaps of embedded
nulls every time the read from the pipe is short (every time with a
block size of 8k).
On the other hand, reading from a file:
gunzip netbsd-rd.gz; dd if=netbsd-rd bs=8k conv=sync
works because the only short read happens at the end of the file and
the conv=sync pads that to 8k which is fine. This is the solution I
adopted, though I am not at all sure dd is doing the right thing.
For the miniroot,
gunzip < mini-root.gz | dd bs=8k of=$T
works (but is slow) because the mini-root is a multiple of 512 bytes.
Ian