Automount, Execute or Own File system/disc partition/drive in Ubuntu

Let’s say, you have an NTFS drive which you want to mount automatically every time you boot your Ubuntu machine. In addition, you want to execute files from that drive, or own that filesystem. For all these, you need to modfiy a file located as /etc/fstab

1. Identify the disc partition

Type in terminal:

sudo fdisk -l

This command will output all the partitions. Look a the first column, labelled as “Device”. Let’s say, your desired partition is /dev/sda2

2. Create a directory to mount the partition

You need to create a directory where the filesystem will be available. Typically, these directories are created in /media location. Let’s say,  you want your filesystem to be available at /media/myNewDrive location. So, type in terminal:

sudo mkdir /media/myNewDrive

3. Edit /etc/fstab file

We’re almost done! Type in terminal:

gksudo gedit /etc/fstab

This will open the file for editing. Add a line at the bottom of the file like this:

/dev/sda2    /media/myNewDrive    ntfs-3g    auto,user,exec    0    0

Wondering what it means? Please visit this link, all of the fields (columns –  you can see there are 6 columns in the line above sperated by spaces) are nicely explained. You will need one line like this for each of the partitions you need to automatically mount/execute etc.

4. Save & Reboot…

Save the file & restart your machine to see effects.

To see various options available, study materials at following links.


A sample /etc/fstab file