Personal tools
You are here: Home Fedora Solved Post Install Solutions True NTFS Read/Write

True NTFS Read/Write

by strikeforce last modified Apr 22, 2009 02:19 PM
— filed under:

How to install and enable the NTFS-3g driver. The NTFS-3G driver is an open source, freely available NTFS driver for Linux with read and write support. It provides safe and fast handling of the Windows XP, Windows Server 2003 and Windows 2000 file systems. Most POSIX file system operations are supported, with the exception of full file ownership and access right support.

Applicable to Fedora Versions

  • Fedora Core 9+

Requirements

Explanation of requirements.
  1. None

Doing the Work

Basic description of what will be done and what is expected.

  1. NTFS-3g should be installed by default, however if it is not perform the following:
  2. su -c 'yum install ntfs-3g'
  3. Once the ntfs-3g is installed you need to set up the mount point.
  4. su -c 'mkdir /mnt/windows'
  5. Now you need to locate your windows partition, do this with the following command.
  6. su -c '/sbin/fdisk -l'
  7. That command should return something similar to the following.
  8. Disk /dev/sda: 200.0 GB, 200048565760 bytes
    255 heads, 63 sectors/track, 24321 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 11572 92952058+ 7 HPFS/NTFS
    /dev/sda2 11573 23321 94373842+ 83 Linux
    /dev/sda3 23322 24321 8032500 82 Linux swap / Solaris

    Disk /dev/sdb: 200.0 GB, 200048565760 bytes
    255 heads, 63 sectors/track, 24321 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 24321 195358401 b W95 FAT32
  9. Now an entry is needed in the files system table, to do so enter the following.
  10. su -c 'nano /etc/fstab'
  11. Now in text editor make and entry similar to the follwing as the last line of the file.
  12. /dev/sda1   /mnt/windows ntfs-3g    defaults,fmask=0000,dmask=0000,uid=500   0 0
    If your partition identifier is not "/dev/sda1" substitute the correct device. (For example it might be "/dev/sda1" if you have a SATA /SCSI drive.) Once the new line is added press ctrl+o, at the File Name to Write: /etc/fstab prompt; press enter, this will save the file. Then press ctrl+x to exit the editor.
  13. Now you need to mount your new partitions.
  14. su -c 'mount -a'
  15. At the prompt enter your root password and press enter.
  16. Close the terminal.
  17. Your Windows partition should now be available in Nautilus under "/mnt/windows".

Troubleshooting

How to test

Explanation troubleshooting basics and expectations.
  1. Use Nautilus and browse your newly mounted Windows directory.
  2. If the filesystem has been mounted already, fstab will need to be re-read and the drive re-mounted. The principle is that the fstab is only read when the drive is being mounted thus any changes to the fstab on an already mounted drive will result in the changes happening on the next mount and/or on reboot. To unmount an already incorrectly mounted drive at /mnt/windows do the following: (please unmount the correct location)
  3. umount /mnt/windows
    Assuming you have correctly set everything up, you may return to step 7 above.
  4. If you have SELinux turned on you will have to redo the mount commands a simple alternative is to disable SELinux
  5. su -c 'nano /etc/selinux/config'
  6. Change your file to look similar to this one
  7. # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - SELinux is fully disabled.
    SELINUX=permissive
    # SELINUXTYPE= type of policy in use. Possible values are:
    # targeted - Only targeted network daemons are protected.
    # strict - Full SELinux protection.
    SELINUXTYPE=targeted

    # SETLOCALDEFS= Check local definition changes
    SETLOCALDEFS=0
    The bold part is the essential section.
  8. Another way to bypass this is to manually mount it on boot and maintain SELinux
  9. su -c 'nano /etc/rc.local'
  10. Your file should look like this
  11. #!/bin/sh
    #
    # This script will be executed *after* all the other init scripts.
    # You can put your own initialization stuff in here if you don't
    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local
  12. Add this line at the end of the file
  13. su -c 'mount -t ntfs-3g /dev/sda1 /mnt/windows -O uid=500,rw,fmask=0000,dmask=0000'
    This should auto mount your windows partition while maintaining SELinux for security reasons.

Common problems and fixes

Describe common problems here, include links to known common problems if on another site

  • You will have problems with SELinux. This is currently getting fixed. Red Hat Bugzilla

More Information

Any additional information or notes.

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net

Added Reading

Document Actions
Log in


Forgot your password?
New user?