I have been using Ubuntu for many years now and this is the first time Ubuntu has disappointed me, with such a major issue left hanging in a release. I upgraded the distribution from 10.04 to 10.10 and then immediately, from 10.10 to 11.04. I didn't do a clean install since I didn't have sufficient time. I have used distribution upgrade before and haven't faced any issue. But this time I was stuck with a system which is in a barely useable state. I can't fall back to the system which worked. I have to find a workaround/alternative to this automounting issue in the current release. Otherwise, I have to do a clean install, in which case I would have chosen the much stabler 10.04 since I didn't want to find similar issues in a clean install too. In either case, I would have to 'waste' time, which was what I was trying to avoid; the whole point of using distribution upgrade. Disappointed. Frustrated. I have advocated Ubuntu to all my friends for a long time now, but I won't be suggesting 11.04 to anyone. Enough of the rant!
I have searched and searched but haven't found a solution to this automounting issue. After days of tracking, I have found some independent alternatives that resolve the automounting issue to some extent, each with their own pros/cons. You can try one of the following 3 independent alternatives - whichever suits you the best.
cdrom and USB flash drives don't automount. cdrom doesn't mount even on clicking the cdrom icon in nautilus computer or left side-bar. USB flash drives aren't even listed in nautilus computer or left side-pane. The only way to mount and unmount cdrom and USB flash drives was using specific commands.
ALTERNATIVE A : halevt
halevt wasn't installed in my system. On installing halevt, I got a post-installation script error. I found a bug in launchpad which says 'halevt failed to install on distribution upgrade' :
A workaround is mentioned in the comments and I tried that out : Install halevt (ignore the error). Comment out the line "invoke-rc.d --quiet hal restart" in /var/lib/dpkg/info/halevt.postinst, Run "dpkg --configure -a", Reboot.
USB flash drive automounts with root permissions. They can't be unmounted without root permissions i.e. they can only be unmounted using specific commands. This issue has been raised in http://ubuntuforums.org/showthread.php?t=1702452.
cdrom doesn't automount. On clicking the icon in nautilus computer or left side-pane, cdrom mounts. It can be unmounted through the 'Eject' menu option on right-clicking the mounted cdrom.
ALTERNATIVE B : udisks scripts
These scripts provide the same behavior as 'Alternative A', but with more customization. The scripts can be found here:
There is an option to 'allow a non-root user to unmount udev-mounted devices. The required username must be hard-coded in the RUN command, so this rule set may not be suitable for multi-user systems.'
ALTERNATIVE C : devmon (udisks wrapper)
Install devmon (http://igurublog.wordpress.com/downloads/script-devmon/) following the instructions : http://igurublog.wordpress.com/downloads/ppa/ ; instead of 'pcmanfm-mod', install 'devmon'.
There are options to customize, but I just used the default and launched the devmon as a background process through the command 'devmon &'.
USB flash drive automounts with user permissions. It can be unmounted through the 'Unmount' menu option on right-clicking the mounted USB flash drive. Note: I don't see a 'Safely Remove Drive' option in the menu, which was present in previous releases.
cdrom automounts. It can be unmounted through the 'Eject' menu option on right-clicking the mounted cdrom.
In System->Preferences->Startup Applications, I added the command 'devmon' with name "Devmon" so that the same command will be run automatically for every user session. However, this is restricted to the current user in which I added it. For 'Startup Programs for all current and future users', I found :
So I ran this command :
Now, everything works as in previous releases, albeit the missing 'Safely Remove Drive' option.
sudo mv ~/.config/autostart/devmon.desktop /usr/share/gnome/autostart/
PS: I am writing this document after trying out all alternatives. So I might have skipped some steps unintentionally while documenting. If so, do let me know.