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.