Monthly Archives: May 2015

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

Creating a Startup Application Script in Ubuntu

If you are new to Ubuntu and have installed various softwares, eventually there comes a time when you want the applications to start automatically just after the system boots.
Following are two ways to add applications to startup list. First is Windows method, while the second method is geeky way (as you must have guessed, it’s my favourite).

Easy method

Just like Windows have a startup folder where you can place shortcut files and which would let you start the applications when user logs in, in Ubuntu there is a ~/.config/autostart folder where you can place the shortcut files. (Just to recall ~/ is your home folder. So ~/.config = /home/username/.config).
You can also use the Startup Applications tool (ships inbuilt with Ubuntu) which lets you add startup applications to that folder. Shortcut files in Ubuntu are files which ends with .desktop. The folder where you can find most of the .desktop files is /usr/share/applications. So you can just find the desktop file related to the particular application and copy the .desktop file into the ~/.config/autostart folder.
If you want to start the application for every user then you would need to copy the .desktop file in /etc/xdg/autostart folder.

Starup Applications Folder and Tool
Autostart Folder on the left and Startup Applications Tool on the right

Continue reading Creating a Startup Application Script in Ubuntu