LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 09: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, 07:05 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
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, 03:34 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
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, 03:36 AM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 51
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, 03:55 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:34 AM
Automounting Of USB Flash Disks / Network Browsing gruelius Linux - General 1 02-26-2007 09:27 PM
automounting my USB flash drive Artex Linux - Newbie 2 08-27-2006 11: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 03:16 AM
FC3 Automounting Flash Media? flysideways Fedora 3 11-11-2004 02:51 AM


All times are GMT -5. The time now is 06:11 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration