From owner-freebsd-questions@FreeBSD.ORG Thu Apr 7 17:55:11 2005 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 C410A16A4CE for ; Thu, 7 Apr 2005 17:55:11 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33A1243D1F for ; Thu, 7 Apr 2005 17:55:11 +0000 (GMT) (envelope-from ts4short@gmail.com) Received: by rproxy.gmail.com with SMTP id a41so512408rng for ; Thu, 07 Apr 2005 10:55:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=lOZHJEgQqibZbjk+Wj40XjY9ZBI1R5OfWswb22k4bmLaRyVXfeEuGAkhXcuUqzT2tkxeol3hqjzjLF1RmfxcbuxdBD+1mlVhkIsPG3FgM4tS/Jw4ZzLVhAUSm7x2j4IWysrKIhe3q+4oRk8dqLmMpWbgJOmPc8ONGTwy6e7wc9Y= Received: by 10.38.74.9 with SMTP id w9mr689857rna; Thu, 07 Apr 2005 10:55:10 -0700 (PDT) Received: by 10.38.12.54 with HTTP; Thu, 7 Apr 2005 10:55:10 -0700 (PDT) Message-ID: <4878093805040710556f71163f@mail.gmail.com> Date: Thu, 7 Apr 2005 13:55:10 -0400 From: Todd Shirk To: freebsd-questions@freebsd.org, Todd Shirk In-Reply-To: <20050406200114.GA64643@slackbox.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <4878093805040612323d984eb0@mail.gmail.com> <20050406200114.GA64643@slackbox.xs4all.nl> Subject: Re: automount usb flash drive? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Todd Shirk List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2005 17:55:12 -0000 Seems like the only thing that will work for me is to make a one-line shell script. I tried the various things you mentioned. I have yet to look at how to use amd(8). Setting vfs.usermount=1 and changing the ownership to the user name in question allows me to mount the usbkey without su'ing. I still can't get the usbd.conf to run an attach command on the umass* action. Thanks for your help. On Apr 6, 2005 4:01 PM, Roland Smith wrote: > On Wed, Apr 06, 2005 at 03:32:14PM -0400, Todd Shirk wrote: > > I was trying to figure out how to have a usb flash drive automount > > when I plug it in. I currently have the following line in /etc/fstab > > > > /dev/da0s1 /mnt/usbkey msdos rw,-m700,noauto 0 0 > > > > and the following in /etc/devfs.conf > > > > perm da0s1 0666 > > devfs.conf only works for devices available at boot time. For devices > you can plug in at runtime you should use /etc/devfs.rules: > > [foobar=10] > add path 'da*s*' mode 0666 > > And you should have the following in /etc/rc.conf: > > devfs_system_ruleset="foobar" > > The contents of devfs.rules are fed to devfs(8), so see it's manual page. > > > when I do the following command line command the usb flash drive mount fine > > > > # mount /mnt/usbkey > > > > But, when I'm in KDE viewing media:/ Removable Device (da0s1) is > > shown is unmounted. > > > > At the user level command line and in KDE, I receive /dev/da0s1: > > Operation not permitted. > > For a user to be able to use a filesystem, there are a couple of things > that need to be done: > - The sysctl variable vfs.usermount must be set to 1 (in /etc/sysctl.conf). > - The user in question must own the mount point. > > > I'm not sure if part of the issue is permissions or if I'm missing a > > piece for the auto-mounting to happen. > > I think the latter. Normally usbd(8) is notified of USB events, but in > this case it seems to get events for the umass* device, not the da*s* > device that you'll want to use. There have been people who've used a > shell-script called by usbd to figure out the connection between > umass<->da from dmesg output and then mount the filesystem, but that > doesn't do umounts. It's also complicated if you want it to work for > multiple users, unless you give it 777 permissions. You could also give > amd(8) a try. > > I found that making a one-line shell script to do the mounting is much > less hassle. > > Roland > -- > R.F. Smith /"\ ASCII Ribbon Campaign > r s m i t h @ x s 4 a l l . n l \ / No HTML/RTF in e-mail > http://www.xs4all.nl/~rsmith/ X No Word docs in e-mail > public key: http://www.keyserver.net / \ Respect for open standards > > >