CSUF LogoCSUF Site Navigation
optics.csufresno.edu

F14 Networking/Filesystem Services & Applications NTFS

Department of Electrical and Computer Engineering
Associate Professor Gregory R. Kriehn
Forums
Wiki
F14 NTFS for Windows Partitions

The Linux-NTFS project is an organization who's purpose is to "develop reliable and full feature access to NTFS by the Linux kernel driver, and by a user space filesystem  (ntfsmount), and to provide a wide collection of NTFS utilities (ntfsprogs) and a developer's library (libntfs) for other GPLed programs." Basically, the project allows for an NTFS partition to be mounted on a Linux filesystem. I find it especially useful when I need quick access to an NTFS partition, say, if I have some data file saved on Windows that I need access to in a pinch. Although full implementation of a read/write driver for Linux does not yet exist, the following announcement was made several years ago:

On 07/14/2006, Project Member Szabolcs Szakacsits presented a new version of our ntfsmount and libntfs, currently given the project internal title ntfs-3g. This version has, apart from several rather unlikely cases, full read/write capabilities and has improved performance. As news spreads quickly, it has already been downloaded and tested by many users, and no incident has been reported so far. Despite of that it is still to be considered beta, and will upon successful testing (in some way or the other) merge into the linux-ntfs ntfsprogs package.

Nice. Very nice.

Most Linux distributions have an NTFS kernel module with full read capabilities enabled with whatever kernel version is currently being shipped in their system. But not RedHat/Fedora distributions
— primarily because they are the largest competitor in Linux-land to Microsoft products, and as such, they are deathly afraid of a lawsuit. But, there's an easy fix.

The first step used to be to install the appropriate kernel-module-ntfs rpm from www.linux-ntfs.org, and to repeat the process each time the kernel was updated on your system. But with ntfs-3g now available in Fedora extras, this is no longer necessary.

Create a /mnt/windows directory, where the NTFS filesystem will actually be mounted.
~> sudo mkdir /mnt/windows
Next, create a mount point by editing /etc/fstab so that the partition will automatically be mounted at boot time. Before adding a line, make sure that you know which partition number your Windows partition is stored on.  For example, my server's first primary partition is a Linux partition for /boot, followed by my Windows partition (even though the partition is at the end of the hard drive). Then I have a Logical partition that contains all of my other Linux partitions except for /boot and /home, and since /home resides on a a final primary partition. As a result, my Windows partition resides on /dev/sda2. Once you determine the NTFS partition number, add the following line:
/dev/[partition #]  /mnt/windows  ntfs-3g  rw,defaults,umask=077,uid=[user],gid=[user]  0  0
On my laptop, the Windows partition is the first one, not the second, so /dev/[partition #] is /dev/sda1. The "umask=077" option sets read-write-execute permissions for all directories for a single user only, which in this case is supplied by the "uid" (user) and "gid" (group) identification names. In other words, I allow myself, and only myself, to have full access to the Windows partition. Save and exit.

Once saved, restart the Network File Systems daemon, netfs:
~> sudo service netfs restart
You should see the daemon successfully stop and restart:
Unmounting NFS filesystems:                                [  OK  ]
Mounting NFS filesystems:                                  [  OK  ]
Mounting other filesystems:                                [  OK  ]
Now change your directory to /mnt/windows (cd /mnt/windows) and list the contents of the directory (ls). You now have full read access to your Windows partition!