Auto mount partitions in few easy steps
April 16, 2011 2 Comments
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:
3) Open fstab
sudo gedit /etc/fstab and add the partitions with the details you found using
/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