Thursday, November 27, 2008

Easy auto mounting NTFS partitions in ubuntu

If you have a dual boot system with Linux and Windows, in all probability you would want your NTFS drives to appear in Linux as well.
You can always edit your /etc/fstab to auto-mount your NTFS drives in Linux..
If you go through the file, you will notice that is is fairly simple to understand the structure and do what this post will describe further (you will need ntfs-3g installed before you can do this too).
It is as simple as adding this line :

/dev/sdax /media/disk1 ntfs-3g defaults,locale=[your locale] 0 0


Here,
/dev/sdax - is the partition to be mounted
/media/disk1 - is the mount point. You can access the files in the partition through this directory
'ntfs-3g' - describes the filesystem
defaults - Uses the default options that are rw, suid, dev, exec, auto, nouser, and async. ( A google serach for the other options might help :) )
locale - the default locale of your system. Can be found by executing 'locale' at the terminal.
The last two numbers stand for 'dump' and 'fsck'.
A 0 in the 'dump' column means the partition will not be backed up.
0 in the 'fsck' column tells the fsck to ignore checking the filesystem, else the number in this column would indicate the order in which the filesystems are checked.

You can do this for each of your NTFS partitions...
However, there is always a possibility of non-geeks ( euphemism :P ... no offence :) ) messing up their fstab...

There is however a clever tool available which will mount your NTFS drives for you at startup, without you having to manually mount them ( a double-click isn't that hard, but then again, you wouldn't even need to do that :) )

In ubuntu,
go to Application | Add/Remove...
Search for 'ntfs configuration tool'
and install it...
unmount any ntfs drives that you may have mounted at this point...
Then, go to Applications | Sytems Tools | NTFS Configuration Tools

At this point you should be presented with a screen asking you to assign mountpoints... just key in the name of the directory where you want the drive mounted. The directory need not exist, it will be created later in the /media directory
Then, after you are done here, make sure you have both the options ticked on the next screen and you are done!

Keeping this post small as there is really nothing much to write...
Will try to make a better one tomorrow...till then...
Cheers! :)