Today I experienced that this automount script perhaps works a little too well..

I'd attached the new digital camera of by brother to my system, and suddently there was a /mnt/usb/DIMAGE/ folder... Only, I had to unmount that file as root, because the camera was clearly waiting for some kind of disconnect signal.

So I'm wondering, what would be a nice way to automate this? (Or provide some sudo command with "unmount.desktop" file )_________________The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ]

Today I experienced that this automount script perhaps works a little too well..

I'd attached the new digital camera of by brother to my system, and suddently there was a /mnt/usb/DIMAGE/ folder... Only, I had to unmount that file as root, because the camera was clearly waiting for some kind of disconnect signal.

So I'm wondering, what would be a nice way to automate this? (Or provide some sudo command with "unmount.desktop" file )

I think just disconnecting the device would be safe. If you use supermount, then it "unmounts" the filesystem as soon as you've finished whatever action you needed to do on the filesystem._________________Postcount ++

I think just disconnecting the device would be safe. If you use supermount, then it "unmounts" the filesystem as soon as you've finished whatever action you needed to do on the filesystem.

Just disconnecting sounds a little scary.. (it was the camera of my brother btw). But I think I should look for this supermount thing, it this makes sure the camera unmounts I'm happy._________________The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ]

I think just disconnecting the device would be safe. If you use supermount, then it "unmounts" the filesystem as soon as you've finished whatever action you needed to do on the filesystem.

Just disconnecting sounds a little scary.. (it was the camera of my brother btw). But I think I should look for this supermount thing, it this makes sure the camera unmounts I'm happy.

I think I lied a little about the unmounting. What supermount does is make sure that all of the data is copied/deleted as soon as the operation has been performed ie. cp foo /mnt/usb/Generic/ will copy the data while the command is executed.

I think that the camera simply acts as a USB mass storage device anyway. I unplug my USB stick all the time and the filesystem has never been corrupted. I almost 99.99999% sure that your brother's camera won't get fubared if you just unplug it. Even moreso if you use supermount._________________Postcount ++

I just installed the automount.hotplug script and it works great with my usb stick.
There is only a couple of things that I would suggest (I wish I was good enough at scripting to do it myself but that's not the case):

I noticed in the todo list that creating a desktop icon was planned. I just installed my first Gentoo desktop under KDE (been using Gentoo on servers for years) so I hacked the script to quickly add an icon to make my life easier. Since scripting isn't my forte it's really a hack but it'll work for ma at least until the script is written properly.
In case someone else is interested here's what I changed:

# Find the name
PRODUCT=`cat /sys/$1/$2/device/model`
if [ -z "$PRODUCT" ]
then
PRODUCT=generic
fi
# Find out who we are going to mount it as
CONSOLEUSER=`stat -c%U /dev/console 2>/dev/null`
if [ -z "$CONSOLEUSER" ]
then
set `ls -l /dev/console`
CONSOLEUSER=$3
fi

If someone knows how to detect the device type and put a proper icon that would be nice too.

I would like to change the mount point from /mnt/usb/devicename to $home/devicename
changing the absolute path is easy, but I'd like to make it selectable with an option switch to do it either way, that where it gets way over my head as far as scripting go. With this browsing my home directory would let me see my usb devices right away instead of going to /mnt/usb/devicename.

well in my rush to get my usb stick to create a desktop icon I failed to add icon for USB devices with more than one partitions. I just noticed after plugging in a USB HD with 2 paritions in it. BTW I noticed this script is a bit old is it even still needed nowadays or is there a better way to do that kind of thing?

I have assembled everything what I found in this thread and made a few mods, here are the highlights:
# - Multiple partitions are now correctly created as separate icons on the user's desktop
# - use supermount and subfs successfuly.
# - allow a definition for using diffrent icons for diffrent drives

It has been tested with ~5 diffrent usb devices and on 4 diffrent machines.

Yes, but that's not always applicable, for example on a machine wich starts a pppd connection (adsl), the pppd will take the /dev/pts/0 first, thus making the permissions go wrong.
I had a permission problem on a few machines doing hibernate (the /dev/console would be owned root after the resume), it could be solved by searching the 'w' command for ':0' (xwindows login) and using the current user, but I was lazy and simply changed USER=theusername in the script.

Oh, yes and the script has problems with drives which don't have any partitions. (some usb sticks are delivered that way)