Need some help with automounting and autounmounting a flash drive
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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. )
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.
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.