From owner-freebsd-questions@FreeBSD.ORG Thu Mar 20 07:43:21 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 E1934106564A for ; Thu, 20 Mar 2008 07:43:21 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr9.xs4all.nl (smtp-vbr9.xs4all.nl [194.109.24.29]) by mx1.freebsd.org (Postfix) with ESMTP id 78DF48FC22 for ; Thu, 20 Mar 2008 07:43:21 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr9.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2K7hCSp009747; Thu, 20 Mar 2008 08:43:13 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 41003B832; Thu, 20 Mar 2008 08:43:12 +0100 (CET) Date: Thu, 20 Mar 2008 08:43:12 +0100 From: Roland Smith To: Da Rock Message-ID: <20080320074312.GB59070@slackbox.xs4all.nl> Mail-Followup-To: Da Rock , freebsd-questions@freebsd.org References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gatW/ieO32f1wygP" Content-Disposition: inline In-Reply-To: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> 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@freebsd.org Subject: Re: removable devices auto umounting 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: Thu, 20 Mar 2008 07:43:22 -0000 --gatW/ieO32f1wygP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 20, 2008 at 11:55:32AM +1000, Da Rock wrote: > I'm just looking into the removable device issue for freebsd. I can see > its easy enough to auto mount a removable device (although I could use > some help getting sd/xd devices working with my card reader), but the > removal seems to come unstuck. >=20 > I have some barely literates on my systems, so I do need to work this > out. Is it possible to use a forced umount to do this? What are the > options here? In short, no. Removal of a USB device would be forwarded to devd(8). But since the device is no longer there at that moment, you cannot unmount it anymore. You might get a nice kernel panic for your efforts, though. ;-) The FreeBSD disk subsystem was simple not written with removable devices in mind, because they didn't exist back then. Until that code is fixed (which is hard) you _have_ to unmount before you pull the device out. One (not bullet-proof) workaround might be to use the automounter [amd(8)], and have it unmount very quickly after they stop being active. This requires setting both the 'cache_duration' and 'dismount_interval' options in amd.conf(5) to very low values. =20 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) --gatW/ieO32f1wygP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkfiFZAACgkQEnfvsMMhpyVk7ACfSeLVXK9+0BW2r6HI+FjHgdUr Da0AoJTG3ahtT0bKlU1B/p7Amjb4l55X =f4/l -----END PGP SIGNATURE----- --gatW/ieO32f1wygP--