[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNU dd and GNU tar See Tape Differently.
From: |
Ralph Corderoy |
Subject: |
Re: GNU dd and GNU tar See Tape Differently. |
Date: |
Fri, 14 Jun 2002 10:47:18 GMT |
Hi Paul,
> Here's one theory. tar stops reading when it sees two blocks of
> zeros. Your tape driver has a bug (or at least an incompatibility
> with the rest of the world): if a program reads exactly to the end of
> a file, but does not attempt to read the first byte past the end of
> the file, the driver leaves the tape positioned at the end of the
> file.
That's possible. I'm using a stock Linux 2.4.18 kernel so I'll go and
ask them about the behaviour.
The st(4) man page says
A filemark is automatically written to tape if the last tape
operation before close was a write.
When a filemark is encountered while reading, the following happens.
If there are data remaining in the buffer when the filemark is
found, the buffered data is returned. The next read returns zero
bytes. The following read returns data from the next file. The end
of recorded data is signaled by returning zero bytes for two
consecutive read calls. The third read returns an error.
Which seems to match the observed behaviour.
> You can test that theory by trying "dd if=/dev/nst0 bs=10240 count=1"
> after rewinding the tape.
Yes, will do. tar's --ignore-zeroes may be of some help too?
Cheers,
Ralph.