Thursday, November 30, 2006

How to Read / Write access Windows NTFS partition in Linux

.

How to mount and access Windows Ntfs partitions from Fedora / RedHat Linux?


Most Linux users dual boot in to Linux as well as Windows. At times, we need to access files of Windows partition while working in Linux. Many new Linux Distributions such as Ubuntu and Mandriva have built in facility to full read/write access to Windows FAT 32 pratitions and read only access to Windows NTFS partitions. But these facilities are not available on default installations in Linux Fedora core or RedHat Enterprise versions due to security or other - Licensing reasons. Here is no nonsense guide for you to how to access (full read write support to Windows FAT 32 as well as NTFS partition, which you can use in other distributions as well) Windows FAT 32 / NTFS partitions in Fedora core / RedHat Linux.

Please note that the commands given in this article must be run as root user.

Step 1: Know the partition that contains Windows FAT / NTFS partitions:

To know which partition contains Windows FAT 32 / NTFS files, give following command:

# /sbin/fdisk -l

The output will be like this:










Precisely note down the partitions which contains Windows file system that you want to access. In general, it will be hda1 (for IDE drive c), and if you have many partitions and more than one hard disk, then it may be like hda2, hda3, hdb1, hdb4, hdd1 for IDE disks (and for SCSI disks, it will be like hdc1, hdc2) etc.

Step 2: Create mount point directory for Windows partitions:

If you have Windows partition say, hda1 (for drive c in Windows) that you want to access, then create a sub directory c in directory /mnt by giving following command:

# mkdir /mnt/c

In this directory, your Windows files will be available for use in Linux after mounting this file system.

Case A - To access Windows FAT 32 partitions : (For Windows NTFS partitions, skip this section and Jump to Case B)

It is simple. Linux Kernel has built in read-write support for FAT file systems. You simply need to create a Windows mount point directory and mount that directory either manually or automatically during boot time.

Case A - Step 1: Mount Windows FAT 32 partition hda1 for read / write access:

To mount newly created Windows mount point directory, you need to add information in /etc/fstab. Start any text editor as root user, say, gedit by giving following command:

#gedit /etc/fstab

Now add following line at the end of the file. AND be sure that there will ALWAYS be a new line at the end of the file - i.e. after entering this line, press return (enter key) key once.

/dev/hda1 /mnt/c auto defaults 00

save the file.












Now give following command:

# mount /mnt/c

There should be no error message if you have done everything right. Now you can browse Windows Dirve C (having FAT32 file system) in Linux in directory /mnt/c through any file manager like Konqueror.

Next time when you boot in to Linux, Windows partition hda1 on /mnt/c will automatically be available to you (that you can change by giving suitable argument in fstab entry)

Case B: To access Windows NTFS partitions:

Currently, Support for Windows NTFS partitions in Linux is available through various kernel modules and drivers. You may opt for module ntfs or driver ntfs-3g with fuse module or some other but you need to configure Fedora / RedHat to load one of these module first and then access Windows Partitions.

Case B Step 1: Install ntfs-3g driver to access Windows ntfs file system

It is recommended to use ntfs-3g driver since it give you full read-write NTFS access and is mostly 'serious-bug-free' and is now pretty robust. You can download and install the suitable RPM package (be sure to download and install ONLY that package MEANT for your Fedora / RedHat kernel, otherwise it will NOT WORK!) from here:

Download ntfs-3g from 'rpm-find.org'


for fedora core 5, download link will be:

ftp://rpmfind.net/linux/fedora/extras/5/i386/ntfs-3g-0-0.5.20070920.fc5.i386.rpm

You will need to install fuse package the upperspace file system kernel module since ntfs-3g depends on that. You can download and install suitable fuse package from:

Download fuse from rpm-find.org


for fedora core 5, download link for fuse rpm package will be:

ftp://rpmfind.net/linux/fedora/extras/5/i386/fuse-2.6.0-2.fc5.i386.rpm

How to install these RPMs?

Simply give following command

#rpm -ivh <file-name>

For example,

#rpm -ivh fuse-2.6.0-2.fc5.i386.rpm

Will install package fuse-2.6.0-2.

You can Refer this detailed article for further assistance:

http://raviratlami1.blogspot.com/2006/07/installing-applications-in-linux.html

.

.

A better way to install ntfs-3g and fuse kernel module is to build it from their source. Download fuse source from here:

http://belnet.dl.sourceforge.net/sourceforge/fuse/fuse-2.5.3.tar.gz

and ntfs-3g source from here:

http://www.puptrix.org/sources/alphabetical/n/ntfs-3g-20070822-BETA.tgz

First untar theses files by giving command:

#tar -zxvf fuse-2.5.3.tar.gz

for fuse and,

#tar -zxvf ntfs-3g-20070822-BETA.tgz

for ntfs-3g.

Now go to directory fuse-2.5.3, and give command:

#./configure

If you have installed all the required development tools, then it will run successfully, else you will get error messages. After successful completion of this command, give following command

#make

and finally, give command-

#make install

Repeate this procedure to install ntfs-3g.

Case B Step 2: Configuring and starting kernel module ntfs-3g

Give command:

#modprobe fuse

If fuse module is successfully installed, then it will produce no error message. Now you can mount your ntfs partition by giving a simple command:

#ntfs-3g /dev/hda1 /mnt/c

provided that hda1 has ntfs file system and you already have created mount point /mnt/c as discussed in Step 2 above. If the command does not produce any error message, then congratulations! you have successfully mounted Windows ntfs partition for read / write access. Start any file manager like Konqueror and browse /mnt/c as you browse in Windows Explorer.

If you want to load fuse kernel module automatically during boot time to automatically mount ntfs volume, append following line

modprobe fuse

to the file /etc/sysconfig/modules/udev-stw.modules

and add following line to /etc/fstab

/dev/hda1 /mnt/c ntfs-3g silent,umask=0 0 0

Now your Linux machine is ready to mount Windows ntfs partition during boot time.

Happy browsing ntfs in Linux!










***-***

No comments:

More Articles...

Translate in your own language

Want to translate this article in your own language? Just click the Flag below