On Thu, 21 Oct 2004 11:46:51 +1300
Douglas Royds <[EMAIL PROTECTED]> wrote:

> I've put this exhange back on the list.
> 
> Nick Rout wrote:
> > do you have hotplug running?
> 
> Yes. I'm successfully mounting the USB drive, and automatically 
> unmounting it after its removal. This depends on the SCSI system putting 
> it in the same place - we've discussed this on the list previously. If 
> I've previously plugged in (and even unplugged) a digital camera, then 
> the USB drive won't mount.
> 
> What I want to add is the timed unmount that autofs can provide, so that 
> I can whip the USB drive out at any time, without having to worry about 
> manually unmounting it.
> 
> I think that I probably need to use automount for the CD as well. Once 
> I've popped a disk in the hole, the little eject button doesn't work - I 
> have to manually unmount the drive (as root) to get it out.
> 
> 

if you want the device to be mountable by a user (ie non root) then i
believe the option "user" in /etc/fstab does the trick.

I am not sure about this, i understood that "sync" was performed by
"umount" so that buffers were flushed before the device was actually
unmounted [1]. if umount is run automagically when you unplug, whats to
stop the data on the device being out of sync with what is in the
buffers?

as far as persistent naming is concerned, this article (again by the
eminently readable Greg Kroah-Hartman) may help:

http://www.linuxjournal.com/article.php?sid=7316


[1] I have been using a rather slow CF card lately for transferring
system images to my zaurus. it can take ages to umount if you have just
written 60M of data to it! The little light on the card reader flashes
the whole time, showing data transfer.


> 
> Jim Cheetham wrote:
> > Yep, that's the one. Debian/Ubuntu package 'autofs'.
> > Here's my simple setup ...
> > 
> > The usb drive that I want hooks up as /dev/sda2 ...
> > /etc/auto.misc (which is named in /etc/auto.master) says
> > bafox           -fstype=ext3                            :/dev/sda2
> > 
> > I'm letting the default timeouts operate, which seems fine.
> > This creates /var/autofs/misc/bafox on-demand - cd to it, and the drive 
> > will be mounted.
> > 
> > For convenience, I symlinked /bafox -> /var/autofs/misc/bafox
> > 
> > The only complication I have at the moment is that Ubuntu likes to 
> > automount things with its own mechanisms, into /media/whatever. I need 
> > to grok these better to either find their timeouts, or disable them. At 
> > the moment, the first program in wins!
> > 
> > If you have windows shares around, consider this line from my 
> > /etc/auto.misc
> > 
> > media -fstype=smbfs,uid=jim,username=jim,password=** ://server/media
> > 
> > 
> > :-)
> > 
> > -jim
> > 
> > Douglas Royds wrote:
> > 
> >> Cool! This is the mechanism (autofs?) that is discussed in the 
> >> greenfly article on hotplug - http://greenfly.org/tips/usb_drive.html
> >>
> >> I'll bring a copy of this article along, and we can give it a crack, 
> >> if you're keen. I'll make sure that I've apt-getted autofs before then.
> >>
> >> Douglas.
> >>
> >> Jim Cheetham wrote:
> >>
> >>>> Also the following USB storage issues: How to ensure that all files 
> >>>> have been closed on the USB drive before pulling it out (some sort 
> >>>> of flush once/sec while it's plugged in)? User isn't allowed to 
> >>>> unmount the drive - have to have root rights to do so!
> >>>
> >>>
> >>>
> >>>
> >>> automount - unmounts the drive after a specified timeout, re-mounts 
> >>> it if you attempt to access the directory it lives in. Wonderful!
> >>>
> >>> -jim
> 
> 
> =======================================================================
> This email, including any attachments, is only for the intended
> addressee.  It is subject to copyright, is confidential and may be
> the subject of legal or other privilege, none of which is waived or
> lost by reason of this transmission.
> If the receiver is not the intended addressee, please accept our
> apologies, notify us by return, delete all copies and perform no
> other act on the email.
> Unfortunately, we cannot warrant that the email has not been
>  altered or corrupted during transmission.
> =======================================================================

-- 
Nick Rout <[EMAIL PROTECTED]>

Reply via email to