Tape drive handling on FreeBSD
Matthew Jacob
lydianconcepts at gmail.com
Sun Dec 18 14:48:23 PST 2005
The first paragraph of mtio(4) describes the usage of a control device.
On 12/15/05, Kern Sibbald <kern at sibbald.com> wrote:
>
> Hello,
>
> We correponded a couple of years ago when Bacula was experiencing data
> loss
> at the end of tapes -- it turned out to be a pthreads bug that suppressed
> the early end of tape warning.
>
> I have a new problem, and if you cannot help, please
> direct me in the right direction.
>
> Basically Bacula (network backup program) needs to open() the tape drive
> so
> that it can read/write it. On both Linux and Solaris, it is possible to
> open
> the drive with O_NONBLOCK and get a descriptor that can be used for
> ioctl()
> calls and providing there is a tape in the drive, it can be used for
> read()
> and write().
>
> On FreeBSD, if there is no tape in the drive, the OS always immediately
> returns errno=ENXIO "Device not configured". This means that on FreeBSD,
> if
> there is no tape in the drive, that drive is totally unusable by
> Bacula. Now
> it seems to me that there are two solutions:
>
> 1. Modify Bacula and system dependent code that opens the control device
> to
> see if a tape drive is really there or not, and then rewrite the tape
> driver
> code to deal with the fact that if you cannot open a device, it may really
> be
> there, and you should continue trying to open it between asking the user
> to
> mount it. This is clearly possible.
>
> 2. Consider implementing something in FreeBSD as exists on at least Linux
> and
> Solaris -- i.e. a means to open the drive and get a valid file descriptor.
> If you read/write/rewind/... a drive opened and there is no tape, it
> should
> either return EIO or better ENOMEDIUM.
>
> Comments?
>
> --
> Best regards,
>
> Kern
>
> (">
> /\
> V_V
>
> -------------------------------------------------------
>
> --
> Best regards,
>
> Kern
>
> (">
> /\
> V_V
> _______________________________________________
> freebsd-scsi at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> To unsubscribe, send any mail to "freebsd-scsi-unsubscribe at freebsd.org"
>
More information about the freebsd-scsi
mailing list