On Sat, 1 Jul 2000, Timothy Shimmin wrote:

> Hi Guys,
> 
> I have a few questions.
> 
> 1) Is there a way to tell if a tape device is in variable sized
>    block mode or fixed block mode ?
>    - having a quick look at the st.c tape driver,
>      is it the case that a block-size (accessed using mt_dsreg) 
>      of 0 indicates a variable sized device ? 
Yes.

>    - In IRIX one can tell by looking at the devicename.
The SCSI tape driver supports different modes for a tape device selected
by a couple of bits in the minor number. The characteristics of these
modes have to be set by the user (system administrator). In this way,
different device names can be attached to fixed and variable modes, if
desired.

> 
> 2) I presume that there is no info kept on what the maximum block
>    size that a tape device handles ?
It is kept internally in the driver. The recent kernels write a message
about the block limits to the system log when the drive is accessed for
the first time but there is no other existing ioctl or other mechanism to
get it out of the kernel driver.

For 2.5 I am planning to implement some /proc files for SCSI tapes and the
maximum block size will be exported in this way. Another thing that should
possibly be implemented some day is a new ioctl to export this kind of
information. I have not seen a good example of this kind of ioctl in any
existing Unix (every Unix seems to define its own versions and none of
those contains all of the information I think should be there).

> 
> 3) For looking at the status of the tape there semms to be
>    mt_gstat and GMT_* macros.
>    Is there any way of telling an early warning, EW, state ?
> 
Not directly. If the drive is programmed to signal EOM when the early
warning is reached, you can look at the GMT_EOT.

        Kai

Reply via email to