From owner-freebsd-questions@FreeBSD.ORG Wed Apr 6 20:01:17 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 3478316A4CE for ; Wed, 6 Apr 2005 20:01:17 +0000 (GMT) Received: from smtp-vbr13.xs4all.nl (smtp-vbr13.xs4all.nl [194.109.24.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50C1843D2F for ; Wed, 6 Apr 2005 20:01:16 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) j36K1EpB046025; Wed, 6 Apr 2005 22:01:15 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 9651563AE; Wed, 6 Apr 2005 22:01:14 +0200 (CEST) Date: Wed, 6 Apr 2005 22:01:14 +0200 From: Roland Smith To: freebsd-questions@freebsd.org Message-ID: <20050406200114.GA64643@slackbox.xs4all.nl> Mail-Followup-To: freebsd-questions@freebsd.org, Todd Shirk References: <4878093805040612323d984eb0@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <4878093805040612323d984eb0@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! Organization: Me, organized? X-Virus-Scanned: by XS4ALL Virus Scanner cc: Todd Shirk Subject: Re: automount usb flash drive? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2005 20:01:17 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 > /dev/da0s1 /mnt/usbkey msdos rw,-m700,noauto 0 0 >=20 > and the following in /etc/devfs.conf >=20 > 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=3D10] add path 'da*s*' mode 0666 And you should have the following in /etc/rc.conf: devfs_system_ruleset=3D"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 fi= ne >=20 > # mount /mnt/usbkey >=20 > But, when I'm in KDE viewing media:/ Removable Device (da0s1) is > shown is unmounted. >=20 > 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 --=20 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 --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCVEAKEnfvsMMhpyURAry9AJ9k65BXKTHKDJQmUKmY1Jw/ETOLoACgsR9R fvr183T7neNLH+fn3c6q9m4= =xw+u -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--