From owner-freebsd-questions@FreeBSD.ORG Thu Mar 20 11:56:14 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 C60D61065671 for ; Thu, 20 Mar 2008 11:56:14 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from angel.comcen.com.au (angel.comcen.com.au [203.23.236.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6EDE58FC25 for ; Thu, 20 Mar 2008 11:56:14 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from [192.168.0.199] (202-172-126-254.cpe.qld-1.comcen.com.au [202.172.126.254]) by angel.comcen.com.au (8.13.4/8.12.9) with ESMTP id m2KBtp9V031681 for ; Thu, 20 Mar 2008 22:55:53 +1100 (EST) From: Da Rock To: freebsd-questions@freebsd.org In-Reply-To: <20080320074312.GB59070@slackbox.xs4all.nl> References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> <20080320074312.GB59070@slackbox.xs4all.nl> Content-Type: text/plain Date: Thu, 20 Mar 2008 21:55:37 +1000 Message-Id: <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-comcen-MailScanner-Information: Please contact the ISP for more information X-comcen-MailScanner: Found to be clean X-comcen-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-16.444, required 4, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.36, BAYES_00 -15.00) X-comcen-MailScanner-From: rock_on_the_web@comcen.com.au 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 11:56:14 -0000 On Thu, 2008-03-20 at 08:43 +0100, Roland Smith wrote: > 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. > > > > 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. > > Roland So by active you mean device access? Or device physical connection? If its simply access, than that would be perfect- user enters the mount point, reads or writes a file, amd times out after X secs and dismounts the device. Physical could be a bit harder... Also, what docs/how-to's would you suggest for AMD? I looked at the man and some freebsd doc pages, but another viewpoint would help. Specifically some more docs on the settings you mention. Bullet-proof is not exactly necessary- nice, but not critical. Suggestions for bullet-proof are very welcome though. What is the worst that can happen if dismounting is not entirely successful? Keeping in mind that this is mostly a desktop system.