[Info-vax] Backup TK50 tapes
Johnny Billquist
bqt at softjar.se
Mon Feb 25 05:04:10 EST 2013
On 2013-02-25 09:49, glen herrmannsfeldt wrote:
> Dennis Boone <drb at ihatespam.msu.edu> wrote:
>>> While i'm sure there are more modern utilities to copy tapes, providing
>>> you know the block structure of the tape, dd should copy it verbatim,
>>> even if you have to write a script to read it block by block.
>
>> NO NO NO!
>
>> I love dd and all, but it THROWS AWAY BLOCK STRUCTURE and leaves you with
>> a byte stream. The block structure is important on tapes.
>
>> Don't use dd to image tapes!
>
> Yes, but he said copy tape, not image tape.
>
> dd if=/dev/tape1 of=/dev/tape2 bs=1024k
>
> should copy a tape as long as blocks are not greater than 1024k.
> (and if they are, use a larger number).
Right. Actually, I think for most hardware, the limit is actually 64k
for one read.
> For Unix tape I/O, read() reads one block, puts into the buffer what
> fits, throws away the rest, and returns the length read.
Yup. And if the read is longer, it just returns as much as was actually
read. So for tapes, the actual number of bytes returned per read is
dependent on both the length of the tape block, and the length of the
read request, with the number of bytes returned being the lesser of
those two numbers. Any excess data is (as you wrote) just thrown away.
And the resulting file you have will have no indication of exactly where
one block ended and the next started, or where you had tape marks.
> Assuming we are talking about drives that can read/write variable
> length records, dd should do it.
dd can read the data bytes, yes. It will not preserve block sizes, nor
keep tape marks.
> But the unix file system doesn't preserve the lengths in read()
> and write() calls, so disk images won't have any.
Not by using dd, no. Write your own program, and preserve the lengths as
a part of the file.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
More information about the Info-vax
mailing list