Tag Archives: Automounting drives

Auto Mounting Drives in Ubuntu

If you are using Ubuntu in dual mode with Windows you must be having a few partition that are NTFS. By default these NTFS drives are not auto mounted. So while you have the partitions, you won’t be able to access them if you don’t mount it.

As you already may know that in Ubuntu (and Linux in general) there are no drives. Combine it with the fact that the root directory starts from a forward slash (/). Every drive in Linux is ‘mounted‘. So when you insert a DVD disk the content of the disk may be mounted to a directory /media/username/DvdLabel. Here DvdLabel is the name of the mounted directory which was taken from the label of the disk.

Similarly if you have a partition with the label, say, Documents when you click the Documents partition, it is then that the Documents partition (or drive) is mounted to /media/Documents.

By default Ubuntu doesn’t mount the partitions when it starts. You have to click the partition in Nautilus (or Files, the file explorer) once so that it can be mounted. This can be irritating since when an application starts which requires a partition they will result in error. Eg, if you have set dropbox to sync to files to Documents drive or Transmission to download files to Multimedia drive.

You can make these NTFS drives automount with Ubuntu by various method as described in this page. But its a long and complicated read. So here is the method explained simply.

Find out Label and UUID

First you need to know the exact Labels and UUID of the drives. Consider UUID (Universally Unique Identifier) as a unique identifier for the drive which will never change (unless you format the drive, re-partition it, or manually change it). To know the Label and UUID you need to use the command blkid command. This command when used with sudo will give you a list of all the partitions along with its Label and UUID. Like below:

vyom@VyomNix:~$ sudo blkid
[sudo] password for vyom: 
/dev/sr0: LABEL="Alpha_0515" TYPE="udf" 
/dev/sda1: UUID="30986b83-1234-4eeb-a30a-482223df145f" TYPE="ext4" 
/dev/sda2: LABEL="WinServer" UUID="3F1234AB1233423C" TYPE="ntfs" 
/dev/sda3: LABEL="Recovery" UUID="A12345E12345AF1B" TYPE="ntfs" 
/dev/sda4: UUID="0659-9A568" TYPE="vfat" 
/dev/sda6: UUID="b1234321-ad5f-4ddd-89ac-eed1234c56c7" TYPE="swap" 
/dev/sda7: LABEL="Digital" UUID="33FA6E12GA6DF687" TYPE="ntfs" 
/dev/sda9: LABEL="Entertainment" UUID="123FHE3E3N98BF65" TYPE="ntfs" 
/dev/sda10: LABEL="Documents" UUID="37MME50B21B7C65B" TYPE="ntfs" 
/dev/sda11: LABEL="Spare1" UUID="654EF123456CAF7E" TYPE="ntfs" 
/dev/sda12: LABEL="Spare2" UUID="68D774EB5DBFPOOI" TYPE="ntfs" 
vyom@VyomNix:~$

Continue reading Auto Mounting Drives in Ubuntu