LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-29-2008, 08:40 PM   #1
grenadier42
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Question Need some help with automounting and autounmounting a flash drive


Hello guys, I need some help with a problem I'm having.

I am running a StepMania computer that is dedicated to StepMania. StepMania has support to play custom songs off of a USB flash drive. I'm using a bare-bones CentOS 5.2 install.

Therefore, I need to be able to mount a flash drive as soon as someone puts it in and unmount it when they take it out (when they are done playing). Also, I need the mount location to be consistent. P1's flash drive mounts at /media/playeroneflashdrive, for instance. When they take the flash drive out, /media/playeroneflashdrive is unmounted so that the next person's flash drive is mounted there. Ditto for P2.

I've tried this with IVMan, and I've got it to the point where it'll automount, but it doesn't unmount automatically, so I don't think that will work...

Any ideas? (A.K.A. tell me how to do it so I can steal it. )

No, really. Any help is appreciated.
 
Old 08-30-2008, 06:05 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I don't think what you want is really possible, because there's no way for the system to know to run the unmount command until after the drive is removed--at which point its too late. If there's still data in the write buffer at the time then you're sure to get some kind of corruption. That's why it's always recommended that you manually unmount the drive before you remove it, i.e. with the "safely remove" option.

The automounting systems I've seen that do have auto-unmounting actually rely on a time-out mechanism; flush the buffers and unmount the drive if it hasn't been accessed in X seconds, then remount it if it's accessed again. I'm not sure if you can do this with ivman, but it might be possible, perhaps with some kind of monitoring script or something.

I'd suggest rather that you create a very visible and easy-to-use "Unmount The Drive" button or something and make sure that all users understand that they have to use it or risk corrupting their data.
 
Old 08-31-2008, 02:34 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by grenadier42 View Post
Hello guys, I need some help with a problem I'm having.

I am running a StepMania computer that is dedicated to StepMania. StepMania has support to play custom songs off of a USB flash drive. I'm using a bare-bones CentOS 5.2 install.

Therefore, I need to be able to mount a flash drive as soon as someone puts it in and unmount it when they take it out (when they are done playing). Also, I need the mount location to be consistent. P1's flash drive mounts at /media/playeroneflashdrive, for instance. When they take the flash drive out, /media/playeroneflashdrive is unmounted so that the next person's flash drive is mounted there. Ditto for P2.

I've tried this with IVMan, and I've got it to the point where it'll automount, but it doesn't unmount automatically, so I don't think that will work...

Any ideas? (A.K.A. tell me how to do it so I can steal it. )

No, really. Any help is appreciated.
there is a
daemon for gnome that automount usb pendrives

the best is the one for suse kde for that also create the ids in /etc/fstab
so that all is done automatically


to unmount that is the problem, since the pc never knows when you wanna trigger the umount:
here could be an idea to use a infrared usb in the box, the guy click on the remote control and it unmount it
http://www.linuxquestions.org/questi...807/page3.html

or with sphinx voice control, you talk to you mic, and it'll umount the pendrive
you can say
"umount my pendrive"
and it makes it !
http://live.gnome.org/GnomeVoiceControl
http://www.youtube.com/watch?v=GCSgkUnlGGA

it isnt that complicated if some talented guys help you
 
Old 08-31-2008, 02:36 AM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Quote:
Originally Posted by David the H. View Post
I don't think what you want is really possible, because there's no way for the system to know to run the unmount command until after the drive is removed--at which point its too late. If there's still data in the write buffer at the time then you're sure to get some kind of corruption. That's why it's always recommended that you manually unmount the drive before you remove it, i.e. with the "safely remove" option.

The automounting systems I've seen that do have auto-unmounting actually rely on a time-out mechanism; flush the buffers and unmount the drive if it hasn't been accessed in X seconds, then remount it if it's accessed again. I'm not sure if you can do this with ivman, but it might be possible, perhaps with some kind of monitoring script or something.

I'd suggest rather that you create a very visible and easy-to-use "Unmount The Drive" button or something and make sure that all users understand that they have to use it or risk corrupting their data.


to unmount that is the problem, since the pc never knows when you wanna trigger the umount:
here could be an idea to use a infrared usb in the box, the guy click on the remote control and it unmount it
http://www.linuxquestions.org/questi...807/page3.html

or with sphinx voice control, you talk to you mic, and it'll umount the pendrive
you can say
"umount my pendrive"
and it makes it !
http://live.gnome.org/GnomeVoiceControl
http://www.youtube.com/watch?v=GCSgkUnlGGA

it isnt that complicated if some talented guys help you
 
Old 08-31-2008, 02:55 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by frenchn00b View Post
to unmount that is the problem, since the pc never knows when you wanna trigger the umount:
Exactly what I said. Both your suggestions and mine essentially do the same thing. Whatever the technique you use, the computer has to somehow be told to run the umount command before the drive is physically removed. And that requires either manual intervention, some kind of timer-based solution, or perhaps some other consistent event that can be used as a triggering mechanism, such when the user shuts down the program that accesses the drive.
 
  


Reply

Tags
automount, ivman, stepmania, usb



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
automounting USB Flash Drive BigWaveDave Linux - Embedded & Single-board computer 10 06-06-2008 09:34 AM
Automounting Of USB Flash Disks / Network Browsing gruelius Linux - General 1 02-26-2007 08:27 PM
automounting my USB flash drive Artex Linux - Newbie 2 08-27-2006 10:27 PM
LXer: EDGE Tech Corp Announces Portable Flash Drive With Muscle - the New 8GB DiskGO!(TM) Now Available; Swap and Go With This Secure Thumb-Sized Flash Drive LXer Syndicated Linux News 0 12-14-2005 02:16 AM
FC3 Automounting Flash Media? flysideways Fedora 3 11-11-2004 01:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration