Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2008 22:10:51 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        Brian Miller <bmiller@lablaw.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Auto Mount USB
Message-ID:  <20080818201051.GA10978@slackbox.xs4all.nl>
In-Reply-To: <7FB5330A2962844C9F95E25CEFA021956F4D90@labex.labnet.lablaw.org>
References:  <7FB5330A2962844C9F95E25CEFA021956F4D90@labex.labnet.lablaw.org>

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

--ew6BAiZeqk4r7MaW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 18, 2008 at 12:06:38PM -0400, Brian Miller wrote:
> All,
>=20
> Not sure how to word all of this. I am trying to auto mount my USB tumb
> drive in FreeBSD (The version that comes with PFSense) I believe most of
> my troubles are related to lack of knowledge.
>=20
> I can mount the drive just fine with the mount command. I also was able
> to add it to the fstab and have it mount at boot.
>=20
> However if the drive is removed it has to be mounted again. How do you
> get it to mount back up with out having to run the mount command again?

You'd have to use an automounter, like amd(8) that comes with FreeBSD. =20
=20
> Also I noticed while playing with it that the device assignment keeps
> changing each time it is plugged back into the system. Started with
> /dev/da0s1, then da1s1, then da2s1, da3s1 and so on. Which means I have
> to change my mount comand every time.

This should not happen. The devfs filesystem that FreeBSD uses removes
device nodes if the devices are removed (unless the devices are still in
use).=20

Are you unmounting the filesystem on the thumbdrive before removing the
drive from the USB port? If not this could be the cause of the
problem. Note that removing a mounted drive can crash your system!
_Always_ unmount a filesystem _before_ removing the device it is on.

[As an aside, FreeBSD's disk device drivers and filesystems predate "hot"
removeable devices by a considerable margin; they were written with the
(implicit) assumption that disk devices are not removed while the system
is running. Although work has been done in DragonflyBSD (a derivative of
FreeBSD 4) to fix this, those changes haven't made it into FreeBSD 6/7.x.]

If you have device nodes for devices that aren't there anymore, you can
try running 'camcontrol rescan all' as root.

If the filesystem on the thumbdrive has a label FOO, you should see that
label as a device node in /dev/msdosfs/FOO (for FAT* filesystems) or
/dev/ufs/FOO (for UFS formatted drives). Unlike the da devices this
doesn't depend on the sequence in which devices are plugged in. Labels
can be made with tunefs(8) (for UFS filesystems) or newfs_msdos(8) for
msdos filesystems.

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)

--ew6BAiZeqk4r7MaW
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAkip10sACgkQEnfvsMMhpyVE/gCfS+si53alqQvI25XJnUAF9Wiq
h1gAnixY0ag7B0lxYQcl2NvFq4Qv0Rip
=HAim
-----END PGP SIGNATURE-----

--ew6BAiZeqk4r7MaW--



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