Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2008 19:30:25 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        "Loren M. Lang" <lorenl@north-winds.org>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: USB Flash Drive Permissions
Message-ID:  <20080411173025.GA79540@slackbox.xs4all.nl>
In-Reply-To: <20080411163640.GA18928@alzatex.com>
References:  <20080411163640.GA18928@alzatex.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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/<label>, which you can use in devfs.rules.

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--C7zPtVaVf+AK4Oqc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)

iEYEARECAAYFAkf/oDEACgkQEnfvsMMhpyWqYwCgmb3w0gg4zZUWZzmOI83mtRh6
fFwAoIyZ35A10kJ1cTlS8ykgZ37QA8cv
=8LDp
-----END PGP SIGNATURE-----

--C7zPtVaVf+AK4Oqc--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080411173025.GA79540>