Dec 31 2008
Mounting a Windows (NTFS) partition
If you have a dual-boot Windows and Linux machine, you may find it helpful to mount the NTFS Windows partition from time to time. The Linux kernels, however, do not come with NTFS support enabled as a rule. This is probably a good thing since the read/write issue between ext3 (Linux) and ntfs (Windows) filesystems is not evident to all users. The following example demonstrates how to mount the ntfs Windows partition in read-only mode so you won’t corrupt the filesystem. What this allows you to copy over files from the Windows-side of the machine to the Linux side. Clearly helpful examples of such copying include: MS Word documents and PowerPoint files, music, pictures, etc.
The following example is not difficult to follow. There are only a few steps, but you will have to be logged in as root (su) to perform the necessary operations.
1. You need to figure out what kernel version you are currently running. From command line, type:
#> uname -r
2. Download the NTFS RPM from the Linux-NTFS project homepage (click here). We are running CentOS 4.x on our machines, which is equivalent to RedHat Enterprise Linux 4. You should have been taken to the appropriate download page. Based on what the ‘uname -r’ command (step 1) returned, select the appropriate version to download from the first block of files (under NTFS RPMs (*.rpm)).
3. You can either choose to download the RPM and then install it using #> rpm -ivh kernel-blah_blah_blah, or just select the ‘Install’ option in the Download Manager. (It worked for me.)
4. By installing the RPM, you have just added the ntfs module to the kernel. You need to insert the module now so run:
#> /sbin/modprobe ntfs
If you get a ‘FATAL’ message, you probably downloaded/installed the wrong version. Check your current kernel version again and go back to the download page (get the right one this time, stupid).
5. As an additional check, run: #> cat /proc/filesystems and make sure that ‘ntfs’ is listed.
6. Now it’s time to mount the drive! You need to do two things first, though, before we mount anything. First of all, you need to create a directory—or mount point—for the NTFS partition. So, do something like: #> mkdir /windows/C or whatever you’d like the mountpoint to be. Secondly, you need to figure out which partition has the NTFS volume on it. A good way to look at the list of partitions on a particular harddrive is to use the ‘fdisk’ utility. For instance, if your primary harddrive (the one with Windows and Linux OS) is /dev/hda then you would run: #> fdisk -l /dev/hda. You are looking for the partition that has HPFS/NTFS under the ‘System’ category. For this example, let’s say that it is /dev/hda2.
7. Yeah, now it’s time to mount it—in read-only mode—to the mountpoint that we created in the last step:
#> mount -t ntfs -r -o umask=0222 /dev/hda2 /windows/C
8. That’s it… go check it out and make sure you can see your data.

