Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 2008 09:40:39 +1000
From:      Da Rock <rock_on_the_web@comcen.com.au>
To:        freebsd-questions@freebsd.org
Subject:   Re: removable devices auto umounting
Message-ID:  <1206056439.27757.152.camel@laptop2.herveybayaustralia.com.au>
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>

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

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!

> 
> <snip>
> > > 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.




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