Re: star tape I/O suggestion

[email protected] Fri, 4 Mar 2011 21:02:49 -0000
Newsgroups gmane.comp.archivers.star.user
Message-ID <500a6fdadb4186b60c6ca432c98d2340.squirrel@ssl-webmail-vh.clara.net>
Joerg Schilling wrote:
>> Yes, that was the point of my suggestion. Instead of writing one tape
>> block at a time, if you set the tape drive to fixed-block mode by doing
>> e.g.
>>   mt -f /dev/nst0 setblk 32768
>> you can then tell star to write in larger chunks, say bs=524288. In that
>> case, each 512KB that star writes should (subject to the tape driver)
>> get
>> written to tape using one WRITE command of sixteen 32KB blocks.
>
> Try to avoid this, it creates tapes that cannot be read on all platforms
> and that need manual intervention on others.
>
>> So there will be no interchange problems due to large tape block size,
>> and no inefficiency from writing one small tape block at a time.
>
> See above, UNIX expects variable blocked tapes

I was under the impression that writing several blocks with one WRITE
command (fixed-length block mode) writes exactly the same data to tape as
several successive one-block writes (in fixed or variable block mode). In
other words, that there's no such thing as a variable blocked tape or a
fixed block tape, they are the same thing. And that any tape could later
be read in variable-block mode.

Could you explain a bit about what problems that can cause? Does it only
apply to certain types of tape/drive? What manual intervention would be
needed to read such a tape in variable-block mode?


>> So ideally, star would be told two things:
>>  - the tape block size (bs= or blocks=)
>>  - the maximum number of blocks in each I/O operation (or alternatively,
>> the maximum I/O size)
>> Then star would perform I/O in maxblocks*bs byte chunks, except the last
>> write which could be a lower multiple of bs.
>
> See man page, star introduced -P in 1985.

I don't think -P would work like that. For variable-block mode, it should
result in the last block being a multiple of 512 bytes (i.e. smaller than
all the previous blocks that were written). For some purposes that's fine,
but I'd want all blocks written to be the same length, so the file can be
read in either fixed-block or variable-block mode.


Mark