Joined: Thu Aug 09, 2007 10:48 am Posts: 106 Location: Artec Design LLC, Tallinn, Estonia
|
|
As I said, automounting is NOT an option, because you'll get unmount event AFTER you should have unmounted and so you just censored your filesystem. So you must unmount it BEFORE the user yanks it out. You can keep it unmounted if it is not used. And mount it as read-only if you are using it for reading only (you can always remount it to rw without unmounting if you still want to do writes too). Keeping the partition mounted for the minimum time is the safest way to go.
So the easiest way is to mount the partition from your application before you open a file from there and unmount it right after.
It is difficult to give wise suggestions if i do not know why and how the usb disk is accessed.
If you really want to use hotplug events, then make a shell script at /sbin/hotplug and make it dumping its environment variables to a temp file. Do a couple of device insertions /removals and see what you've got. Or have a "tail -f filename" running on that temp file to see it on-the-fly.
|
|