How to install and enable the fuse NTFS-3g driver. The fuse 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 Centos Versions:
- Centos 5.x
Requirements
- You need RPMForge repo installed and configured.
Doing the Work
This howto assumes you are the root user on the system.
- You need to install fuse-ntfs-3g
- Once the ntfs-3g is installed you need to set up the mount point.
- Now you need to locate your windows partition, do this with the following command.
- That command should return something similar to the following.
- Now an entry is needed in the files system table, to do so enter the following.
- Now in the vi text editor make and entry similar to the follwing as the last line of the file. (hint: use i for insert)
- Now you need to mount your new partitions.
- Close the terminal.
- Your Windows partition should now be available in Nautilus under “/mnt/windows”.
1 |
<strong>yum --en=rpmforge install fuse-ntfs-3g</strong> |
1 |
<strong>mkdir /mnt/windows</strong> |
1 |
<strong>fdisk -l</strong> |
1 |
Disk /dev/sda: 200.0 GB, 200048565760 bytes<br />255 heads, 63 sectors/track, 24321 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sda1 * 1 11572 92952058+ 7 HPFS/NTFS<br />/dev/sda2 11573 23321 94373842+ 83 Linux<br />/dev/sda3 23322 24321 8032500 82 Linux swap / Solaris<br /><br />Disk /dev/sdb: 200.0 GB, 200048565760 bytes<br />255 heads, 63 sectors/track, 24321 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sdb1 * 1 24321 195358401 b W95 FAT32<br /> |
1 |
<strong>vi /etc/fstab</strong> |
1 |
<strong>/dev/sda1 /mnt/windows ntfs-3g defaults,fmask=0000,dmask=0000,uid=500 0 0</strong><br /><br />If your partition identifier is not "/dev/sda1" substitute the correct device. (For example it might be "/dev/sdb2")<br />Once the new line is added press the esc key, then :wq to "write + quit" the editor, this will save the file with the<br />recent changes you made.<br /> |
1 |
<strong>mount -a</strong> |
Troubleshooting
How to test
- Use Nautilus and browse your newly mounted Windows directory.
- 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:
- If you have SELinux turned on you will have to redo the mount commands. a simple alternative is to disable SELinux temporarily.
- Change your file to look similar to this one
- Another way to bypass this is to manually mount it on boot and maintain SELinux
- Your file should look like this
- Add this line at the end of the file
1 |
<strong>umount /mnt/windows</strong><br /><br />Once you've made the necessary changes and assuming you have correctly set everything up, you may return to step 7 above.<br /> |
1 |
<strong>setenforce 0</strong> (This sets SeLinux temporarily to permissive mode)<br /><strong>getenforce</strong> (This will tell you the current status of SELinux)<br /><strong>setenforce 1</strong> (This sets SELinux back to enforcing mode)<br /><br />To check:<br /><strong>vi /etc/selinux/config</strong> |
1 2 3 4 5 6 7 8 |
<strong>IMPORTANT NOTE: It is NOT recommended to leave SELinux disabled. If you have trouble with SELInux it is best to solve the<br />problem rather than bypass important system security.</strong><br /><br /># This file controls the state of SELinux on the system.<br /># SELINUX= can take one of these three values:<br /># enforcing - SELinux security policy is enforced.<br /># permissive - SELinux prints warnings instead of enforcing.<br /># disabled - SELinux is fully disabled.<br /><strong>SELINUX=permissive</strong> # 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 |
1 |
<strong>vi /etc/rc.local</strong> |
1 |
#!/bin/sh<br />#<br /># This script will be executed *after* all the other init scripts.<br /># You can put your own initialization stuff in here if you don't<br /># want to do the full Sys V style init stuff.<br /><br /><strong>touch /var/lock/subsys/local</strong><br /> |
1 |
<strong>mount -t ntfs-3g /dev/sda1 /mnt/windows -O uid=500,rw,fmask=0000,dmask=0000</strong> |
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 may have problems with SELinux. This is currently getting fixed. Red Hat Bugzilla
More Information
Disclaimer
We
test this stuff on our own machines, really we do. But you may run into
problems, if you do, come to #centos on irc.freenode.net