From owner-freebsd-questions@FreeBSD.ORG Thu Mar 20 23:42:19 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 D73851065673 for ; Thu, 20 Mar 2008 23:42:19 +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 81DA28FC17 for ; Thu, 20 Mar 2008 23:42:19 +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 m2KNeiIB079086 for ; Fri, 21 Mar 2008 10:40:45 +1100 (EST) From: Da Rock To: freebsd-questions@freebsd.org In-Reply-To: <20080320131443.GD64490@slackbox.xs4all.nl> References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> <20080320074312.GB59070@slackbox.xs4all.nl> <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> <20080320131443.GD64490@slackbox.xs4all.nl> Content-Type: text/plain Date: Fri, 21 Mar 2008 09:40:39 +1000 Message-Id: <1206056439.27757.152.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.447, required 4, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.35, 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 23:42:20 -0000 On Thu, 2008-03-20 at 14:14 +0100, Roland Smith wrote: > On Thu, Mar 20, 2008 at 09:55:37PM +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 all honesty, I'm not sure FreeBSD (or any other OS, for that matter) > is suitable for 'barely literates'. A computer is not a toaster. True enough. But at least they know how to plug in and unplug a device- I just don't know if they'll remember to umount first! > > > > > 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. > > > > So by active you mean device access? > > I mean access to the auto-mounted directory, or files therein. That'd be perfect then. > > > Or device physical connection? If > > its simply access, than that would be perfect- user enters the mount > > point, > > User needs to plug in the device first! > > And it is actually worse. Depending on if and how the usb device was set > up, you need to use the device daX[sY], where X depends on how many other > da devices are already in use, and the optional Y depends on how it was > sliced (partitioned in DOS parlance). > > Furthermore, you need to know which kind of filesystem is used. Most > thumbdrives are msdosfs, but larger ones might be ntfs as well. > > For msdosfs, I use: > 'mount_msdosfs -m 644 -M 755 -o noatime -o sync -o noexec -o nosuid $DEV $DIR' > I'm sure I could script something to get around that. That shouldn't be too hard, but I take your point: I need to consider nearly all possibilities. > > 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. > > I've never used amd, so I can't help you there. :-) > > > 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. > > Last time I tried unplugging a USB device before unmounting it I got a > kernel panic. > > Roland That last point would only occur if the device was still being written to- right? I'm sure my users can be trained at least that far... I will watch out for that though. Thanks for the input. I reckon I can get it working (relatively) smoothly now. Don't suppose you know anything about setting up internal card readers in laptops at all? Trouble is I don't think it's hooked up to the usb bus. Its a Texas Instruments model.