2011-12-18

Mac OS X Lion with NTFS Read/Write support

Ref 1: https://github.com/osxfuse/osxfuse/wiki/NTFS-3G
Ref 2: http://blog.nolar.info/ntfs-3g-in-mac-os-x-lion-10-7-with-read-write-support

NTFS-3G for Mac OS X


Installation

Download and install the latest version of "FUSE for OS X" from http://osxfuse.github.com. When installing "FUSE for OS X" make sure to select the "MacFUSE Compatibility Layer" option. More information about the MacFUSE compatibility layer can be found in the Frequently Asked Questions.
"NTFS-3G for Mac OS X" - NTFS-3G 2010.10.2 - can be downloaded from this blog post ("NTFS-3G for Mac OS X" blog). This is the most recent installer package for OS X. When installing NTFS-3G click the "Customize" button in the "Installation Type" section and deselect the "MacFUSE" option. MacFUSE is fully replaced by "FUSE for OS X".
If you are installing "NTFS-3G for Mac OS X" on OS X 10.7 or later, read the "fuse_wait" section under "Known Issues".

Uninstallation

To unistall "NTFS-3G for Mac OS X" open the "System Preferences" application, go to the NTFS-3G preference pane and click on the "Uninstall NTFS-3G" button

Frequently Asked Questions

1. Why is NTFS-3G's write performance so poor with "FUSE for OS X"?

The ntfs-3g program opens and does I/O to the block device /dev/disk[number] of the NTFS volume in question. OS X does not have a VM buffer cache for block devices when they are accessed in this way. That is the most overwhelming factor, because both metadata operations and file data I/O boil down to read/writes by NTFS-3G to the block device.
Suppose we somehow automagically provided unified buffer caching for block devices by essentially making a disk look like a giant file. Even then, OS X and its buffer cache is really happy only when you do I/O that is in units of page size (4KB) and aligned on a page boundary. To get the most out of the I/O subsystem in OS X, ntfs-3g (or any other program for that matter) would really want to do I/O in multiples of 4KB.
For comparison, you should try writing to an NTFS disk image. You will see that it is considerably faster because you do have some caching in that case.
There are versions of NTFS-3G available that have additional user-space caching with drastically improved performance. See the "NTFS-3G for Mac OS X" blog.

2. After installing NTFS-3G, my Boot Camp volume stopped showing up in the "Startup Disk" preference pane. I am devastated. Is reinstalling OS X, Boot Camp, and Windows the only recourse?

Relax. The "Startup Disk" preference pane is simply filtering out (that is, not displaying) any mounted volumes that it does not consider bootable. Its definition of a Boot Camp volume includes that the mounted volume either be of type msdos or ntfs - this is hardcoded into the preference pane plugin. This does not mean your Boot Camp volume has become unbootable. It is merely not showing up in the graphical user interface. You can hold the "opt" key during startup and choose the Windows partition to boot from. You can also remount it (read-only) using the NTFS file system built into OS X and it should start showing up in "Startup Disk".

3. I am getting a timeout error every time I mount a NTFS formatted volume. What to do?

You are probably running OS X 10.7 or later. See the "fuse_wait" section under "Known Issues" for more details and a workaround.

Known Issues

fuse_wait: Timeout error on OS X 10.7 and later (NTFS-3G 2010.10.2 or earlier)

fuse_wait is a tool distributed with "NTFS-3G for Mac OS X". It executes a specified MacFUSE/"FUSE for OS X" mount program with all of its arguments and displays an error message in case the mount operation fails. Because of a change in OS X 10.7, fuse_wait displays a timeout error every time a NTFS volume is mounted.
A package containing a patched version of fuse_wait fixing this issue can be downloaded at bfleischer/fuse_wait/downloads. More information about the fix including manual installation instructions can be found at bfleischer/fuse_wait.
Note: This is an unofficial patch, that is intended as a workaround until a new official version of NTFS-3G is released.



Ref 2:

NTFS-3G in Mac OS X Lion (10.7) with read-write support

Posted by – August 20, 2011

UPD 21.08.2011: There is even better way to solve the same issue with native Mac OS X drivers, but it has its own pros and cons. Read at the end for details.
UPD 12.09.2011 (IMPORTANT): Native driver makes NTFS unusable. Read below for details.
Mac OS X Lion (10.7) was released recently, in the end of July 2011. And many users had started to complain that their NTFS disks stopped working. And the much worse problem is that “old” solutions do not work well.
But after one or two weeks of researching of this issue, I’ve managed to make NTFS work in Mac OS X Lion (10.7). The key here is a proper combination of software versions.
So I will shortly describe the usual choices for external data storages, and what problems arises with each of them. And later I will show how you can get the most universal way — NTFS — to work where it does not work by default, with links and pictures.

Data Storages

The only reason to worry about this problem is an ability to access external storage drives. Even if these are your own drives and you can select a filesystem to use, that choice is not easy.
There are few possible choices for large (~1TB) file storages, but each has very unpleasant limitations and issues:
* HFS+/HFSX (or “Mac OS Extended”/”Mac OS Extended (case sensitive)”) — okay with big volumes and big files, but works natively under Mac OS X and Linuxes only. Windows need third-party software, which is either free file browser/extractor or paid low-level drivers.
* FAT32 work in each and every OS now, but has limitation for file size up to 4GB (so, you cannot store DVD image, which is usually 4.5+ GB).
* FAT64 (exFAT) is a new solution, but it works natively only in Mac OS X and Windows 7. Older Windows systems (Vista, XP) require Service Packs and updates to support exFAT. Linuxes do not support exFAT yet at all. More on that, it has only one file table, so if this only place will be corrupted on write, I will get all the data lost.
* NTFS. Okay with big files an bug volumes. Works natively in all Windows systems. Works fluently in all Linux systems. Has native read-only support in Mac OS X. But has not write support under Mac OS X.
As you can see, in terms of cross-compativility, NTFS is the best choice: it works almost everywhere, and with no limitations. The only issue is write mode in Mac OS X.
Taking into account that you probably have a lot of friends with NTFS volumes, who can visit you and bring you something interesting there, you actually have no choice except as try to make NTFS working.
So, let’s do it.

Paid NTFS Solutions

But first, in case you want to make your own research, or you are looking for a solution that just works out of the box, and you are ready to pay for it, you can give a try to Paragon NTFS for Max OS X 9.0 for $19.99 (5-days trial). That is much cheaper than Tuxera NTFS for Mac for $36.02 (with 15-days trial).
The former one definitely works – I’ve tried it in trial. Just install and get everything ready: both read and write modes, auto-mount, and also NTFS formatting in Disk Utility, disk checking, etc.
I haven’t tested the latter one, so you can leave a comment here about your experience with Tuxera paid solution.

Free NTFS Solution

This free solution requires some efforts. Not so much, of course. Well, if you are going to make your own research, it can be lots of efforts, since the situation with NTFS-3G is not very clear now.
But if you are just about a ready, copy-n-install solution, it will be easy, and requires only these two or three steps:
* MacFUSE 64-bit.
* NTFS-3G stable.
* “15 seconds” error work-around (optional).

MacFUSE 64-bit

First, you need MacFUSE with 64 bit support. That is the main problem with Mac OS X Lion — it uses 64-bit kernel, and all previous version of Mac OS X used 32-bit one. So, old MacFUSE binaries won’t work anymore.
You can get Tuxera MacFUSE 2.2 image for free (could not find a page with it, just a download links) or try to compile OSXFUSE from sources. I’ve used the former one.
You can see MacFUSE preferences in “System Preferences”. Well, actually these are not preferences, but only “update” and “uninstall” actions, and current version info:

NTFS-3G stable

Second, you will need working copy of NTFS-3G. Long story short, NTFS-3G is either already dead or is going to die. There is its ancestor: Tuxera NTFS for Mac (paid).
But we are going to use old version of NTFS-3G — the one from 2010. I’ve got one from here. But you can try googling for it, or browse here for this exact version (not 2011 — I’m not sure they work).
I also tried to install later version from MacPorts, but it does not work too: mounts something that stills unreadable. That is in addition to an error in installation process (“mv” does not see the libntfs-3g file or so).
Now, when you have installed two binary packages, you can restart Mac OS X and try to attach the drive. It should work.
NTFS-3G preferences pane looks populated and interesting:

“15 seconds” error work-around

But it will show you the error message saying that there were not signal in 15 seconds:

This is not a big problem, because everything works fine. Only annoying message box is a problem.
So the third, optional step is to address this issue. You can follow this link: https://gist.github.com/1100318 (see first and the only comment under the code). You just download this attached C file, run “gcc” command line from the comment, and replaces the “fuse_wait” binary as said there. Yes, you will need “gcc” here.
Quoted comment
Because of a change in Mac OS X 10.7, fuse_wait (a tool distributed with NTFS-3G for Mac OS X) displays a "15 seconds" timeout error every time a NTFS volume is mounted.
Download this gist and run the following commands to build and install this unofficial version of fuse_wait, that fixes the issue. Please note that Xcode has to be installed for this to work.
sudo mv /usr/local/bin/fuse_wait /usr/local/bin/fuse_wait.orig
chmod +x build.sh
./build.sh . /tmp /
NTFS-3G and other filesystems using fuse_wait should now mount fine (without the timeout error) and stay mounted. Don't forget that this is just a workaround. This issue has to be fixed in an updated version of NTFS-3G.
To revert to the original fuse_wait, run the following command in Terminal:
sudo mv -f /usr/local/bin/fuse_wait.orig /usr/local/bin/fuse_wait
I hope this helps.
And voila! Now you have working NTFS filesystem for free with no “15 seconds” error message. Profit!

Problems

Nevertheless, Mac OS X is a Unix-based system. And Unix-based system is a big problem when they work as desktop OS (earlier I thought that on Linux-based system because of community-driven and crowd-based development concept). This solution has some problems too. Though they are not about the solution itself, but about the components used.
The most important problem now is the speed: with this NTFS-3G on MacBook Air (4GB, i7 CPU) write speed for USB 2.0 drive is about 3.3 MB/s. Just to compare, the same drive in the same port, but with exFAT/FAT64 partition can write with ~38 MB/s (or fast enough to make exact estimation; will try larger files later).
Also, immediately following the mount of a drive, there is a line in system log with an error message saying:
8/20/11 6:27:48.394 AM fseventsd: could not open <
> (No such file or directory) 8/20/11 6:27:48.434 AM fseventsd: log dir: /Volumes/MYPASSPORT/.fseventsd getting new uuid: FA7C5FF2-4B57-40CA-9BC6-871C36C13C23 Where MYPASSPORT is a volume label. This file exists there, but it is updated each and every time you mount this filesystem. I guess this is because of fuse_wait wrapper, which ignores the signals that filesystem was successfully mounted, and “fseventsd” tries to read the file while filesystem is only being mounted. But it makes no problems, luckily.

UPD: Using native drivers from previous Mac OS X versions to speed up write operations

There is even better way to solve the same issue with read-write access to NTFS volumes, which involves native drivers from previous Mac OS X versions. It is described in Russian here. Credits for this method go to Casing from macdaily.me blog.
In a nutshell, you should use classic solution with “/sbin/mount_ntfs” wrapper script (that does not work in Lion on its own), and you should replace the kernel extension module for NTFS with the one from Mac OS X 10.6.8 (only one binary file: /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs).
To do so, download this archive (mirror: NTFS_Enabler.zip), and follow the instructions in “Terminal-CMD” text file. Do not forget to “disable” NTFS-3G (globally or for your specific drive) in System Preferences before using this method.
PROS:
  • High speed of write operations – about 30 MB/s (compare to 3 MB/s with NTFS-3G).
  • Deleted files go to the Trash folder rather than deleted instantly as with NTFS-3G.
CONS:
  • Well, this is a hack after all. One day it will stop working.
  • Mac OS X updates can overwrite your replaced NTFS driver, and you have to re-install it again.
  • Disk Utility cannot create new NTFS volumes with the native NTFS driver.
  • If a volume was ungracefuly unmounted in Windows, it will be mounted read-only in Mac OS X, saying this message in system log:
8/21/11 12:48:43.000 AM kernel: NTFS-fs error (device /dev/disk1s1, pid 4859): ntfs_system_inodes_get(): $LogFile is not clean. Mounting read-only. Mount in Windows.
All the “cons” can be solved by installing NTFS-3G and keeping it disabled all the time, except when you need to format new volume, or to mount a problematic volume. Actually, it is better to enable NTFS-3G, mount it with NTFS-3G, then unmount, disable NTFS-3G, and mount it with native drivers; or use “ntfsfix” if you are not afraid of command line after all these hacks ;-)
IMPORTANT UPD 12.09.2011: Please read comments below: people say that this driver makes NTFS filesystem corrupted and unusable.
I had the same experience: my NTFS volume become only partially readable in Mac OS X, and completely unusable in Windows.  More on that, when I tried to attach the drive, Windows kernel started to use 100% CPU, and did not stop to do so even when the drive were detached. Drive letter never appeared.
Luckily for me, I had two backups of the whole volume (I do so when experimenting with new drives, since I once lost my whole photo archive due to burned out new drive). To solve the whole problem of NTFS@Mac, I’ve finally bought Paragon NTFS for Mac.

1 comment:

crackswindow.com said...

Great set of tips from the master himself. Excellent ideas. Anyone wishing to take their blogging forward must read these tips. Thank you .Paragon NTFS 17.0.72 Crack with Serial Number Free Download