如何在Mac OS X Lion(10.7) 中读写 NTFS 分区格式

转载自:http://blog.nolar.info/ntfs-3g-in-mac-os-x-lion-10-7-with-read-write-support/


简单把文章内容说一下,其余的细节和可能的问题等自己看英文吧。


问题:如何在Mac OS X Lion(10.7) 中读写 NTFS 分区格式?

回答:

  • 若打开NTFS-3G时出现问题(“15秒错误”提示,其实不影响读写,只是这个窗口会弹出来就让人讨厌),下载一个C程序在Mac下编译即可解决。
    • 下载后在任意目录下解压,然后打开终端进入该目录,照着下面的复制粘贴执行就行了。
      • sudo mv /usr/local/bin/fuse_wait /usr/local/bin/fuse_wait.orig
      • chmod +x build.sh
      • ./build.sh . /tmp /
        


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


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.

And voila! Now you have working NTFS filesystem for free with no “15 seconds” error message. Profit!


本人注:附上comments的原文。上述代码下载地址:https://gist.github.com/gists/1100318/download

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.


 

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 <</Volumes/MYPASSPORT/.fseventsd/fseventsd-uuid>> (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.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值