From owner-freebsd-questions@FreeBSD.ORG Tue Oct 28 13:33:48 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 583E916A4CF for ; Tue, 28 Oct 2003 13:33:48 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FAEE43FCB for ; Tue, 28 Oct 2003 13:33:45 -0800 (PST) (envelope-from freebsd-questions@m.gmane.org) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AEbTB-0002cT-00 for ; Tue, 28 Oct 2003 22:33:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AEbTA-0002cL-00 for ; Tue, 28 Oct 2003 22:33:40 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AEbTA-0000VO-00 for ; Tue, 28 Oct 2003 22:33:40 +0100 From: Jesse Guardiani Date: Tue, 28 Oct 2003 16:33:40 -0500 Organization: WingNET Lines: 63 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org User-Agent: KNode/0.7.2 X-Mail-Copies-To: never Sender: news Subject: Re: usb pendrive problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jesse@wingnet.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2003 21:33:48 -0000 Jesse Guardiani wrote: > Howdy list, > > A co-worker of mine has a neat little usb pen drive. > > I set it up properly in /etc/usbd.conf with this > entry: > > ----------------------------------------------------- > # The entry below mounts Todd's Pendrive when the Pendrive is plugged in. > # It then umount's the Pendrive when the device disappears. > # > device "pendrive" > devname "umass[0-9]+" > attach "sleep 1 && /sbin/mount /home/todd/pendrive" > detach "/sbin/umount -f /dev/da0s1 /home/todd/pendrive" > ----------------------------------------------------- > > And it's set up in fstab with this entry: > > ----------------------------------------------------- > /dev/da0s1 /home/todd/pendrive msdosfs rw,noauto 0 > 0 ----------------------------------------------------- > > But, the problem with all of the above is that > the detach command doesn't work because the device > is already removed before it can run umount! > > Frequently, I've found myself with two pendrives > mounted: > > ----------------------------------------------------- > /dev/da0s1 122M 43M 79M 35% /usr/home/todd/pendrive > /dev/da1s1 122M 43M 79M 35% /usr/home/todd/pendrive > ----------------------------------------------------- > > But the first one is a ghost, and if either are umount'd, > my kernel panics and my system reboots! > > Is there a way to reliably umount an already disconnected > umass0 SCSI-2 device? I'm guessing from the silence that this is a negatory. Perhaps this has something to do with the fact that the umass device is created first, and then the da SCSI device is emulated off of that? Still, you'd think the programmer would have built some fool-proofing into the driver, especially once you consider the highly hot-pluggable nature of USB... Drat... Looks like usbd or the umass driver need some work. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net