Automount – Fix Can’t Automount Two Partitions at Login

automountntfsstartup-applicationsudisks

I'm using Ubuntu 12.04.
I wanted two of my NTFS partitions automounted on startup, so I followed the instructions on Ubuntu documentation (https://help.ubuntu.com/community/AutomaticallyMountPartitions).
I chose the "per-user mounting" since I'm the only user anyway and I didn't want to mess with fstab 'cause I don't know how to set the correct options and my fstab doesn't already have entries for the NTFS partitions.
So I added to "Startup Applications" the command /usr/bin/udisks --mount /dev/disk/by-uuid/5E1089A41089842D

It initially worked for the first partition I set on Startup Applications, but when I added the command for the second partition (which is identical except for the different UUID), the first command disappeared. In other words, it does work, but only for one partition. Whenever I add a new entry on Startup Applications, the previous one disappears, as if Ubuntu doesn't allow two entries for the same program (udisks in this case).

Is it a problem with Startup Applications, or is there something I don't know?
Is it possible to mount two partitions on the same command (without mounting all partitions, since I have other partitions I don't want automounted)? I didn't find it possible on man mount.

Best Answer

Make a shell script

http://www.wikihow.com/Write-a-Shell-Script-Using-Bash-Shell-in-Ubuntu

use the instruction above but replace the line:

ls

with your two mount command lines:

/usr/bin/udisks --mount /dev/disk/by-uuid/xxx
/usr/bin/udisks --mount /dev/disk/by-uuid/yyy

then (after saving [somewhere in your home folder] and making executable) direct to the script in "Startup Applications".

that's it