From owner-freebsd-scsi@FreeBSD.ORG Sun Dec 18 22:48:23 2005 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B4C716A41F for ; Sun, 18 Dec 2005 22:48:23 +0000 (GMT) (envelope-from lydianconcepts@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A5E843D53 for ; Sun, 18 Dec 2005 22:48:22 +0000 (GMT) (envelope-from lydianconcepts@gmail.com) Received: by wproxy.gmail.com with SMTP id i31so990889wra for ; Sun, 18 Dec 2005 14:48:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=DCbNxzWFtzaBg1qyeyQ3DTZ2msqTEZHsvkHorQSJ5EYMbDo4Y3xGzvIHLhs1cTJR5IDty+286tBVs3WMax6tPGQq6NkUu+yUDXkiHQM5Iizbc3gcAWDMSpLLv+O7zcAtNjBulsl6quQ7OQtexak9Un1DruFnuN6dDTIn5DfUSrA= Received: by 10.65.132.20 with SMTP id j20mr2402421qbn; Sun, 18 Dec 2005 14:48:21 -0800 (PST) Received: by 10.65.155.20 with HTTP; Sun, 18 Dec 2005 14:48:21 -0800 (PST) Message-ID: <7579f7fb0512181448x1dc4b3f4m9d5112cc6bc9fc1a@mail.gmail.com> Date: Sun, 18 Dec 2005 17:48:21 -0500 From: Matthew Jacob To: Kern Sibbald In-Reply-To: <200512151122.34949.kern@sibbald.com> MIME-Version: 1.0 References: <200512151122.34949.kern@sibbald.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-scsi@freebsd.org Subject: Re: Tape drive handling on FreeBSD X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2005 22:48:23 -0000 The first paragraph of mtio(4) describes the usage of a control device. On 12/15/05, Kern Sibbald 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=3DENXIO "Device not configured". This means that on FreeBS= D, > 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 reall= y > 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" >