Auto mount partitions in few easy steps

When we log in to Linux we have to mount partitions manually. In some earlier distributions of Ubuntu we had to enter the root password too. This is troublesome and I’m going to give you few easy steps to mount these partitions on start up or rather as we call it to auto mount these partitions.
First we have to understand what fstab is. The term fstab stands for file system table.  It contains the startup script which relates to mounting partitions so we have to add our partitions to the fstab. fstab looks like a table at a glance it has these columns

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

<file system> – this stands for the location of the partition. (eg: /dev/sda2)

<mount point> – the place in the file system where we want to mount the file system. (eg: /media/work)

<type> – the file system type. (eg: ntfs, ext4)

<option> – here we want to mount it automatically so it should be auto

<dump> – the archiving schedule for the partition.

<pass> – the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be either 2 (to check after root) or 0 (to disable checking for that partition altogether).

Now lets get to the fun part;

1) Mount the partitions manually then open a terminal and give df -h this will list all the mounted partitions with the file system details.

2) Unmount the partitions and then make directories with the names you like to give to those partitions in media eg: mkdir /media/Work

3) Open fstab sudo gedit /etc/fstab and add the partitions with the details you found using df -h
eg:
/dev/sda7 /media/Work ext4 auto 0 0
/dev/sda1 /media/Win7 ntfs auto 0 0

4) Now restart the machine 😀

hope this was helpful 😀
Bye! for now
😀

About Rusiru Boteju
A peculiar or otherwise odd person, especially one who is perceived to be overly obsessed with one or more things including those of intellectuality, computers, technology, etc.

3 Responses to Auto mount partitions in few easy steps

  1. nadeendra says:

    I goth the same issue as I run ubuntu with win XP side by side and after few google searches I found a good GUI tool call “NTFS Configuration Tool” , After few clicks all my NTFS partitions start to mount on system startup 🙂

    http://goo.gl/eMlTX

  2. Biz says:

    good article keep it up

Leave a comment