Is there a program to mount all of my drives automatically?

This works in 12.10 - 16.10

Type Disks in Dash, and you will get:

enter image description here

Click on the little gears icon, to get the sub menu, and choose Edit Mount Options. After that you will see:

enter image description here

Change the Automatic Mount Options to ON. do that to all the drives that you need mounted on start-up.

Note: Be careful with what you modify, it may cause the system not to work properly.


How to auto mount NTFS part/disks in Ubuntu

Press the Ubuntu button, start your disks application.

disks

select your NTFS Partition/Disk? Press the configuration button select Edit Mount Options...

Edit Mount Options

Turn off the Automatic Mount Options, select Mount at startup. choose your Display Name Like Data or partition-Data or seriously-not-porn, whichever best describes your personality?!

Mount Options window

Mount Point means where do you want it to be mounted! this could be /mnt/DATA//home/username/part-data or /home/username/Videos/no-porno again, what best describes your personality! After that Press OK, type in your password, again OK. and restart your system, and see your mounted HardDiskdrive.

source

  • How To: auto mount NTFS part/disks in Ubuntu - EuroBytes

If you want to do this by your own script (without using any program) then the following may help you:

Create file named automount in /usr/local/bin and give it execution permission (sudo chmod +x).

  • case-1 : sudo without password (If you have set NOPASSWD in /etc/sudoers:-)

    Contents for /usr/local/bin/automount:

    #!/bin/bash
    cd /dev/disk/by-label
    for label in *
    do
        partition=$(basename $(readlink $label))
        sudo mkdir /media/$USER/$label
        sudo mount /dev/$partition /media/$USER/$label
    done
    exit
    

    Then create Strartup Application (gnome-session-properties) and Add the following:

    screenshot

  • case-2 : sudo needs password (If you have not set NOPASSWD in /etc/sudoers):-

    Contents for /usr/local/bin/automount:

    #!/bin/bash
    cd /dev/disk/by-label
    user=$(zenity --entry --text="Enter Username")
    for label in *
    do
        partition=$(basename $(readlink $label))
        sudo mkdir /media/$user/$label
        sudo mount /dev/$partition /media/$user/$label
    done
    exit
    

    Alternatively you can set <username> permanently instead of $user.

    Then create Strartup Application (gnome-session-properties) and Add following:

    screenshot2

    Note: For running gksudo, the package gksu must be installed. If not first do: sudo apt-get install gksu


Additional Notes:

  • This script mounts partitions on /media/$USER/<Disk-Label>.

  • To check/change labels of your partition, you can use gnome-disk-utility:

    gnome-disk-utility

    screenshotforlabel

Tags:

Mount