From owner-freebsd-questions@FreeBSD.ORG Fri Apr 11 17:30:29 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431DC106566B for ; Fri, 11 Apr 2008 17:30:29 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr1.xs4all.nl (smtp-vbr1.xs4all.nl [194.109.24.21]) by mx1.freebsd.org (Postfix) with ESMTP id A71328FC1E for ; Fri, 11 Apr 2008 17:30:28 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id m3BHUPVQ079253; Fri, 11 Apr 2008 19:30:26 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id BE296B82D; Fri, 11 Apr 2008 19:30:25 +0200 (CEST) Date: Fri, 11 Apr 2008 19:30:25 +0200 From: Roland Smith To: "Loren M. Lang" Message-ID: <20080411173025.GA79540@slackbox.xs4all.nl> Mail-Followup-To: "Loren M. Lang" , FreeBSD Questions References: <20080411163640.GA18928@alzatex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <20080411163640.GA18928@alzatex.com> 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! User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: FreeBSD Questions Subject: Re: USB Flash Drive Permissions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2008 17:30:29 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 11, 2008 at 09:36:40AM -0700, Loren M. Lang wrote: > I would like to setup my USB flash drive to have special permissions > when I plug it into my desktop. Specifically, I would like it to be > owned by my user so I can user mount the msdos fs on it. I added an To mount as a normal user you need to own the mount point. And set the sysctl vfs.usermount to 1.=20 > entry to /etc/devfs.conf for the device it was creating, but the > permissions did not get applied when I plugged my drive in. After some > research, it appears that devfs.conf only gets applied on boot by > /etc/rc.d/devfs so I took a look at devd. For setting permissions on hotpluggable device nodes, you need to look at devfs.rules. See http://www.xs4all.nl/~rsmith/freebsd/index.html#hotplug > I catted the pipe of devd and > saw my device attach as umass0 with a serial number that would be ideal > to match on (I'd prefer that it only match on my personal flash > drive,) Normally, a da device gets the first available number. This way you cannot tell which device node your flash drive will get. You will need a to set a label on the flash drive. The tool newfs_msdos or the mtools port can do that for you. Next time you plug the device in you will find it as /dev/msdosfs/