1

On my dual OS machine (Ubuntu 14.04 and Windows 8.1), I want to automount two partitions at boot time. To that end, I followed the steps for Per-User Mounts on https://help.ubuntu.com/community/AutomaticallyMountPartitions.

It all works fine, unless I add the other partition to mount as a separate entry, as shown in the picture. Two mount entries

After reboot, the last mount entry in the Startup Applications Preferences has gone away. So it seems I can only automount one partition at a time, at least if I want to use gnome-session-manager.

Is this intended or is this a bug?

I also tried putting both commands in one entry (/usr/bin/udisks --mount /dev/disk/by-uuid/C4C23530C2352856 /usr/bin/udisks --mount /dev/disk/by-uuid/2A4C62C34C628981), but then only the last partition is mounted.

(Note: I do mount my partitions with fstab now, but I am still wondering why Startup Applications Preferences can only deal with one mount command.

1

After long discussion, @Fabby and I agreed that this behaviour is a bug. Hence I filed a bug-report: https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1408129

0

To make the mounts available for all users

Type the following commands:

mkdir /media/MountName1
mkdir /media/MountName2

(where MountName is the name you want to give the mount point)

Add the following lines to the end of your fstab:

file system mount point   type  options       dump  pass
/dev/disk/by-uuid/C4C23530C2352856  /media/MountName1 ext4    errors=remount-ro 0       2
/dev/disk/by-uuid/2A4C62C34C628981  /media/MountName2 ext4    errors=remount-ro 0       2

To make the mounts available for 1 user

Go to a terminal Ctrl+Alt+T

Type sudo gedit /usr/local/bin/MountOneUser and press Enter

Copy-paste the following text:

#!/bin/bash
# This script automounts a mountpoint as requested in http://askubuntu.com/questions/562268
# Copyright (c) http://askubuntu.com/users/344926/fabby 2014

# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. See the GNU General Public License for more details.
# You DID NOT receive a copy of the GNU General Public License along with this program as the license is bigger then this program.
# Therefore, see http://www.gnu.org/licenses/ for more details.

/usr/bin/udisks --mount /dev/disk/by-uuid/C4C23530C2352856 
sleep 1
/usr/bin/udisks --mount /dev/disk/by-uuid/2A4C62C34C628981

Save the file and exit the Gnome Editor.

Type in the terminal window:

sudo chmod +x /usr/local/bin/MountOneUser

Open start-up applications, add the following command: MountOneUser and type as "Name" and "Comment" whatever will remind you in the future what this is about.

Log out log back in.

Your mistake is that you're trying to run 2 commands on one line, not separating them with "&" or "&&". It's a bit more work in the beginning to make a script, but if you need to add any more mounts later, it'll be easier then typing one extremely long command in Startup Applications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.