Automatically Mounting Partitions in Ubuntu

Categories Ubuntu

If you have many partitions of your disk then you can see that when you start Ubuntu all partitions doesn’t get mounted automatically. If you want all of your partitions or a particular partition to be mounted automatically, it can be done easily with method given below (Taken from Ubuntu documentation) :

First of all run following command in terminal to list the partition table of all disks present on your computer:

user@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1276c8c9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   209922047   104857600    7  HPFS/NTFS/exFAT
/dev/sda3       209922048   914837489   352457721    7  HPFS/NTFS/exFAT
/dev/sda4       914837490   976768064    30965287+   7  HPFS/NTFS/exFAT

This command displays all of your partitions on all disks. First column named ‘Device’ is your partition. The last column displays the System name of your partition. The following table displays the System name to linux type of some common System types:

System name
English name
Linux type
W95 FAT32
Microsoft FAT32
W95 FAT32 (LBA)
Microsoft FAT32
W95 FAT16 (LBA)
Microsoft FAT16
W95 Ext’d (LBA)
Microsoft extended partition
Not used
NTFS volume set
Microsoft NTFS
NTFS volume set
Microsoft NTFS with read-write access
Apple HFS

Now our next step is to create location where we want to mount our partitions. For this purpose run following commands in terminal:

user@ubuntu:~$ sudo mkdir /media/a

For all partitions you want to mount and replace ‘a’ with the name you want to give your partition mount location.
Now our next step is to edit Ubuntu’s file system table. To do this run following command in terminal:

user@ubuntu:~$ sudo gedit /etc/fstab

and place following line at the end of file:

/dev/sda3  /media/a  ntfs  user,fmask=0111,dmask=0000  0  0

Here replace /dev/sda3 with your ‘Device’ name, /media/a with the path you created for mounting your disk, ntfs with ‘Linux type’ of your partition user,fmask=0111,dmask=0000 is additional option for permissions of partition for ntfs type partition. You can replace it with according to your partition type using table below:

Description Accessible by everyone Accessible by a subset of users
FAT(16/32) partition
NTFS partition
Apple Partition

For more on these options see man mount.
Now restart your system and see all partitions you want have been mounted automatically. 🙂

Embedding terminal in Gedit

Categories Editor, Ubuntu

You can embed terminal right in gedit in it’s bottom panel. Gedit has a plugin called “embedded terminal” which is by default not there in plugin lists of gedit. But you can install all remaining plugins using simple command:

user@ubuntu:~$ sudo apt-get install gedit-plugins

After that go to gedit edit>Preferences>Pluins and activate “embedded terminal”. You can see that you also got some new cool plugins. You can activate them according to your need to extend your Gedit.

Screenshot at 2012-02-07 20-27-41

But after activating Embedded Terminal you can see that theme of embedded terminal does not match with your default terminal.

Screenshot at 2012-02-07 20-36-02

You can fix that. But first you need to install dconf-tools. You can do this by issuing following command in terminal:

user@ubuntu:~$ sudo apt-get install dconf-tools
Now start dconf-editor by issuing command dconf-editor or from application menu.
In dconf-editor navigate to org>gedit>plugins>terminal.
Here you can edit background-color, foreground-color, fonts etc. according to your choice.

Screenshot at 2012-02-07 20-43-37

And you can get the look and feel you want for your embedded terminal in Gedit.

Screenshot at 2012-02-07 20-48-11