# NTFS file system



## Ang31 (Dec 28, 2008)

Regards to all,
can you tell me how to set kernel that could write to NTFS file system or give me some tutorial?

P.S I edit fstab and mount ntfs partition but i can not write data only read.


----------



## Oko (Dec 28, 2008)

You can install fusefs-ntfs-1.2531 and just follow this 
simple howto http://lordhendrix.wordpress.com/2008/01/13/mounting-ntfs-to-freebsd-or-unix/

I am not sure if FreeBSD kernel has native ability to write 
NTFS since I am not using NTFS. If it does I am pretty sure 
the driver has to be compiled or loaded into the kernel.


----------



## ale (Dec 28, 2008)

The ntfs kernel module provides read-only support.
As said by Oko, if you want to write, you have to install sysutils/fusefs-ntfs


----------



## Zephyrus (Dec 28, 2008)

I think that the only thing you need to be aware when using the ntfs3g driver on freebsd is that it doesn't work perfectly when the system is under load. The following is the relevant excerpt from the README.FreeBSD file from fusefs-ntfs port:

```
When reading/writting the same file repeatedly while doing many simultaneous
operations on different files sometimes the former one fails: read(2) returns
-1 and sets errno to EAGAIN. This is because of a difference between the FUSE
kernel implementation in Linux and FreeBSD, and is being worked on. An example
scenario would be playing a song in XMMS, while building many ports, which
could cause XMMS skip the song. Another observed problem is the current
directory not being found, but entering again would work. The details are
described in fuse4bsd (sysutils/fusefs-kmod) documentation (Linux access is
path based while FreeBSD is vnode based, which may be reused)
```


----------



## kamikaze (Dec 29, 2008)

You also need to know that until the module is unloaded you cannot be certain that all data has actually been written to the disk. Therefore you should add some things to your rc.conf:
	
	



```
fusefs_enable="YES"
fusefs_safe="YES"
fusefs_safe_evil="YES"
```

The first line will load the kernel module upon startup and attempt to unload it upon shutdown.

The second line will keep on trying to unload the module upon shutdown until it succeeds. This prevents data loss.

The third line will lay the shutdown watchdog to rest while this is attempted to ensure that it doesn't interrupt the shutdown script. I've had cases where the system needed more than 2 minutes to write all data to the disk. However the watchdog timer hits after 30 seconds, so in this case the fusefs_safe_evil flag is necessary to prevent data loss.


----------



## Erratus (Dec 29, 2008)

BTW can it be done that a NTFS system reads the UFS file? This might be the safer design?


----------



## ale (Dec 29, 2008)

Erratus said:
			
		

> BTW can it be done that a NTFS system reads the UFS file? This might be the safer design?



Do you mean w2k/xp?
ufs2tools dot sf dot net


----------



## ter2007 (Dec 31, 2008)

Last time I tried it, I could not write to ntfs. Read it just fine, but not write.


----------



## ale (Dec 31, 2008)

ter2007 said:
			
		

> Last time I tried it, I could not write to ntfs. Read it just fine, but not write.


It's what Erratus [post=7117]asked[/post]


----------



## fonz (Feb 5, 2009)

*How about at boot time?*



			
				Oko said:
			
		

> You can install fusefs-ntfs-1.2531 and just follow this
> simple howto http://lordhendrix.wordpress.com/2008/01/13/mounting-ntfs-to-freebsd-or-unix/



Just a quick follow-up question on this: how does one go about having this done at boot, can you specify a path like /usr/local/modules/fuse.ko in /boot/loader.conf somehow or do you need something like /etc/rc.local?

Alphons


----------



## kamikaze (Feb 8, 2009)

No, you have to use the late option for mounting during boot.


----------

