Auto Mount Drive/Partition on start up (Ubuntu)

For those of you who want simply a GUI for this, we have the psydm storage manager in the Ubuntu Software Center.

However, I personally don’t like the work it does. It has been erratic for me. So here’s a very simple method to manually auto-mount drives on startup.

Please note, that the drives are mounted as a root user which implies they can’t be unmounted by the normal user. But they are otherwise accessible.

It is better practice to mount drives using UUID. This is because UUID for every disk is unique, and is a pre-existing identification. The other common method, /dev/diskname, is the name given by the operating system.

Make sure your drive is unmounted.

Open Terminal

sudo mkdir /media/<mydiskname>
sudo blkid

Copy the UUID of the disk you want to mount.
open fstab file in  an editor of your choice. I will use vi.

sudo vi /etc/fstab

We see the following columns :
file system : can be specified with UUID or /dev/
mount point : the point the disk should be mounted at. In this case, /media/<mydiskname>
type : Type of file system – ntfs, ext4, ext2, fat
options : you can either go for defaults, or if you want to know more about them, then look here
dump : Usually value 0
pass : Usually value 0 but you can read more here

Add the following entry:

UUID=<previously-copied-uuid> /media/<mydiskname> ntfs defaults 0 0

exit the file.
And then run

 sudo mount -a 

On next reboot, the filesystem would be mounted automatically.



One thought on “Auto Mount Drive/Partition on start up (Ubuntu)

  1. Pingback: Linux : Access mounted drive from Media Servers | TechKnowHow

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s