CEG's Linux User Group

  • Increase font size
  • Default font size
  • Decrease font size
Home General Mounting NTFS partitions automatically

Mounting NTFS partitions automatically

E-mail Print
User Rating: / 3
PoorBest 

This tutorial assumes that you have 'ntfs-3g' (a Linux-NTFS open-source driver) installed in your linux machine.Also the use of sudo preceding a command is merely to indicate that superuser privileges are needed for the command to work

In many Linux distro's, the NTFS partitions are automatically detected and mounted at startup, while some are not mounted at boot time.It becomes really frustrating to mount each partition at every startup of the machine. Hence i have outlined simple steps to mount all NTFS partitions at boot time..


step 1: Open a terminal, type 'sudo blkid' and enter the password.

Step 2: Here is a sample output that i get in my Linux machine which runs Debian 5:.The label corresponds to the label of drive in windows to faciltate easy recognition

/dev/sda1: UUID="1E18A53118A508BB" LABEL="Vista" TYPE="ntfs"

/dev/sda2: UUID="FCEAAEECEAAEA1FE" LABEL="Entertainment" TYPE="ntfs"

/dev/sda3: UUID="1258C9FB58C9DE1B" LABEL="Education" TYPE="ntfs"

/dev/sda5: UUID="90BC3FF7BC3FD706" LABEL="Extra" TYPE="ntfs"

/dev/sda6: UUID="1fd1a32a-3eb6-4dff-8653-1231ee25eb6d" TYPE="ext3"

/dev/sda7: UUID="e688daa9-3a59-49eb-96d6-d0b696b28fdc" TYPE="ext3"

/dev/sda8: TYPE="swap"

 

Step 3: In terminal type 'sudo gedit /etc/fstab' .A file with few lines written in it opens up in gedit..
for those who use other text editors like kate,vi,emacs etc...use them in place of gedit.

Step 4: There are many fields in the fstab file.Many tutorials are available that cover each field in depth. I would just like to tell you what is to be typed in, in simple terms.

The first field is the device..it is the same as first field of table 1.

The second field is the mount-point and usually contains a path for a folder in the system(usually empty). It is a common practice to create folders in '/media' folder

The third field denotes the type of partition.You must type in 'ntfs-3g' in this field to mount the NTFS partitions .

The fourth field denotes options..Just type in 'defaults' in that field.

The fifth and sixth fields can take values of 0 and 1 respectively.

Here is an example to mount /dev/sda1 as in table 1.Note the usage of LABEL and mount point as similar for easy identification.

/dev/sda1 /media/vista ntfs-3g defaults 0 1

Once you type in an entry for each NTFS partition you need, save the file and return to terminal

step 5: The mount-point folders you mentioned in fstab usually does not exist.actually it is better that way. So create those folders in the mentioned path. It requires administrative privileges to create them in /media folder.

So use 'sudo mkdir' to do the job.Example is

sudo mkdir /media/vista

Make sure all the folders you mentioned as mount points in fstab file, now exist as empty folders.

Step 6: type 'sudo mount -a' to mount all the partitions as mentioned in the fstab file.you will see that all the Drives now appear in desktop (in Debian, Ubuntu) or atleast can be accessed at the correspomding mount-points.

Last Updated on Thursday, 11 June 2009 20:55  
Comments (1)
1 Friday, 06 November 2009 22:28
sunilsakthikumar
coolkid your post has been very helpful
thanx.......
you rock
Please register or login to add your comments to this article.