Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 2003 17:15:20 -0400
From:      Jesse Guardiani <jesse@wingnet.net>
To:        freebsd-questions@freebsd.org
Subject:   usb pendrive problems
Message-ID:  <bnc4p8$7dp$1@sea.gmane.org>

next in thread | raw e-mail | index | archive | help
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?

Thanks!

-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bnc4p8$7dp$1>