Friday, October 5, 2007

NTFS-3G 1.1004 package for Mac OS X

That's right.. the package has been updated to NTFS-3G 1.1004. This version supposedly fixes an issue with file corruption when dealing with sparse files.
ntfsprogs 1.13.1 (from http://www.linux-ntfs.org) is also included. The package structure has been slightly altered so it will require a reboot after install.

Download NTFS-3G 1.1004 (Update 2) (package by catacombae)
Requirements: Mac OS X 10.4, a PowerPC or Intel computer, MacFUSE 0.4.0 (or later) installed.

Changes for Update 1: Changed ntfsprogs back to 1.13.1 from 2.0.0 because of lockup issues with unclean/hibernated NTFS file systems tracked to ntfsprogs.
Changes for Update 2: Bugfix for fuse_wait. It didn't return the proper exit code when the mount operation failed. This confused OS X, but it should be fixed now.

Note: I'm still unable to test the package on PowerPC systems, but it will probably work. Somebody intrested in donating old PPC hardware?

The source code for ntfs-3g 1.1004 is available here.
The source code for ntfsprogs 1.13.1 is available here.

46 comments:

Anonymous said...

Can you post a howto for creating universal binaries for Mac OS X?
I want to build some projects for both architectures.
email: raymondv at gmx dot de
(in english or german)

thanks

Erik said...

anonymous, October 5, 2007 4:42 PM:
If you use gcc from the command line, you just need to add '-arch i386 -arch ppc' before all other options when compiling to get the ppc and i386 architectures into one binary.
Behind the curtains, it's actually done by compiling the source code twice, once with the i386 compiler and once with the ppc compiler, and then combining the two resulting binaries together with the command line utility "lipo" which creates fat binaries.
You could even compile four architectures into one binary, for example:

gcc -arch ppc -arch ppc64 -arch i386 -arch x86_64 -o hello_world hello_world.c

(This only works for simple unix apps... as soon as you need to use the OS X frameworks, you'll discover that they usually can't be used together with ppc64 or x86_64 code. Not even Foundation.)

It wouldn't be much of a FAQ, as it's very straightforward. :)
For example, when i build ntfs-3g, I pass the following flags to the configure script (at the end of the invocation command line):
CFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" LDFLAGS="-arch i386 -arch ppc"

Andreas said...

I am using NTFS-3G to write to a partition I use for Windows Vista. However, after installing MacFUSE and NTFS-3G I can no longer select this partition as a boot disk under System Preferences -> Boot Disk. It just doesn't show up. I am able to select it and boot from it when I hold down the option/alt key during boot though. Is this a known problem? Any solution? Thanks for a great product though :)

Erik said...

andreas:
You're absolutely right! I haven't noticed it before, but I can confirm that it's an issue with my MacBook as well. I don't use that feature at all... and I have no idea what that preference pane looks for in a file system.
Thanks for pointing out this flaw, even though I have no solution for the problem at the moment.

Anonymous said...

Regarding the disappearance of the main Windows NTFS disk from the Startup Disk system preference, I might be wrong, but my hunch is it an NTFS-3G disk won't appear there not because it's writable, but because it is an ejectable disk! After all, if the disk can be ejected, it must be external, and you're not supposed to boot into Windows using an external disk.

If my hunch is correct, perhaps we should ask ourselves why an NTFS-3G Boot Camp disk should be ejectable, when it is internal. Can such internal NTFS-3G disks be made non-ejectable? It would also be a good idea to unmount them when shutting down OS X, so that the shutdown process can be shorter.

Andreas said...

Thanks for your reply Erik. As long as it is a "known" bug I am happy. Can't really demand anything more. After all, I'm not paying for it :)

Anonymous said...

Hi!

I've downloaded your ntfs package and tried to install it on my Powerbook G4, though there were two strange things happening:
First it said me, I have a newer package already installed.
Second, when I hit install, it says that there aren't any packages t install!
Any ideas?

kind regards

Erik said...

Peter:
So... I assume you did have a previous NTFS-3G package installed? Where did you obtain that package? I hope it wasn't from me, because I have successfully upgraded two of my older NTFS-3G installations to 1.1004 without problems.
You can always uninstall a previous NTFS-3G package by running the Uninstall script featured in the disk image for my release before trying to install my package. It should clean out any old remnants.

Anonymous said...

Hi Erik,

no I didn't use any of your packages so far, indeed it seems the one Ive been using is now longer being developed on! So I hope that uninstalling it and installing yours cleanly will do the trick!

thanks,
Peter

Anonymous said...

Hi,

alright, it worked, removed the old package and installed yours, now everything has gone alright!

Thanks for your help

Anonymous said...

Hi Erik!

Tack som fan for reviving NTFS-3g for OS X!

I can't mount my NTFS drive and I suspect it's because Windows was in hibernation mode when I took the drive. The Windows computer is complete and utterly dead so I can't wake the drive from hibernation mode. Is it possible to check the drive in OS X if it's in hibernation mode or not?

If it is in hibernation mode, is it possible to make the drive writable anyways? Since the Windows computer is dead I have no plans on waking this harddrive from hibernation so I don't care about all the problems that would normally appear if the file structure had changed while Windows was in hibernation.

Thanks again!

Erik said...

Magnus:
Varsågod. :)
It's possible to force mount the drive using /usr/local/bin/ntfs-3g directly from the command line.
For example, if I wanted to force mount the drive /dev/disk0s3 in the empty directory ~/ntfsmount I would type:

sudo /usr/local/bin/ntfs-3g /dev/disk0s3 ~/ntfsmount/ -oforce,locale=sv_SE.UTF-8

I'm not sure if this clears the flag that tells ntfs-3g that the file file system is "in use". Hopefully it does so it mounts automagically afterwards.

Anonymous said...

Erik, thanks, but the 'force' option doesn't seem to work. When I use '-oforce' I get this output from ntfs-3g:
----
Windows is hibernated, refused to mount.
Failed to mount '/dev/disk1s1': Operation not permitted
The NTFS partition is hibernated. Please resume and shutdown Windows properly, so mounting could be done safely.
----

Also, I'm starting to wonder what my problem actually is. If I have ntfs-3g installed and plug in my ntfs drive something seems to block all access to that drive. Diskutil won't respond if I try to list all disks/partitions and if I try to manually mount the drive with ntfs-3g I get an access violation message (I don't remember exactly what it said unfortunatelly)

I suspect it's the automatic mount script that cause some problems. Basically, when I tried to force mount the drive I had to uninstall ntfs-3g, plug the drive in, wait for the volume to be mounted with the Apple ntfs filesystem, unmount the volume with diskutil, install ntfs-3g and when the installation program said "restart your computer" I tried to force mount, and that's when it failed.

Is it possible to not automatically mount with ntfs-3g for now, until I actually have it working? I tried to remove the mount line i the mount_ntfs3g.sh script (don't exactly remember the name) but OS X still tried to do something that cause diskutil to stop responding.

Sorry for the long post. :) I am seriously considering changing file system to FAT32 on the disk, especially if write performance is bad (the disk is connected with USB2), but it would be sweet if I could stick with NTFS for now.

Erik said...

Magnus:
I've had another report on Disk Utility locking up with the latest version of the driver. I'm investigating the issue, which seems to have something to do with how probing is done. Ultimately, I blame the newest version of ntfsprogs, but I haven't got any evidence yet to support that accusation.

Have you tried to downgrade to the 1.913 package? It shouldn't cause any lockups at least.
Mounting your drive will prove difficult though if ntfs-3g refuses to mount it even with the force option due to hibernation. I guess you'll have to attach it to a Windows computer in order to fix that.

FYI, the script called by OS X's disk arbitration is not /sbin/mount_ntfs-3g, but
/System/Library/Filesystems/ntfs-3g.fs/ntfs-3g.util
It might prove to be more difficult disabling that massive script... so I'd advise a downgrade to 1.913, or a complete uninstall.
I'd also advise you to contact me if you have time to help me finding out what the problem is with this version of the driver. Mail address can be found at http://hem.bredband.net/catacombae

Unknown said...

Actually the reason startup disk doesn't see an NTFS disk for booting is because apples driver isn't being used. This was a known issue even with shadows release. In his original release notes he even said that boot camp will only detect startup disks using apples driver and as a result is the primary reason the opt-out option with .read-only feature was added to his binary. Which of course is annoying if reboot regularly with boot camp. The only real work around is hold option key and reboot to choose a new startup disk. Or disable NTFS-3G on your bootcamp partition. On my macbook i actually just stopped using NTFS-3G and repartitioned drive as HFS+, FAT32, and NTFS and use the FAT32 as a shared documents drive for both operating systems, 10.4 and Vista, booted on either one, i have a usable writable disk both OS's see. And as an added bonus vista cant mess with the HFS one, and mac os X with it's read only driver in tact can't mess with vista, so it also keeps OS's from messing with eachother. Good solution all around.

Erik said...

Adam: Did you seriously find it that annoying, that you decided to repartition your disk because of this issue alone? :s
Holding the option key on startup and select your Windows drive requires much less work than going into the System Preferences, clicking "Startup drive", selecting the drive to boot from and reboot... which is why I have never done it that way.

Formatting a shared partition as FAT32 works, but it's hopelessly limited. I'd use ext2, which has less limitations, as there are open drivers for both OS X and Windows that can deal with ext2.

By the way, if you still want to access your HFS+ data from Windows, I have written a free and open source application for that, HFSExplorer. Check it out at http://hem.bredband.net/catacombae
*advertising* ;>

Erik said...

I recently updated my package twice in a very short period of time.
The reason for the first update was that some users have been reporting lockup issues in Disk Utility and elsewhere which seemed to stem from the new version of ntfsprogs (2.0.0). I'm throwing this newest version out and reverting to 1.13.1 until I'm convinced that the problem is fixed.
The second update is a bug fix for fuse_wait, which didn't behave correctly when NTFS partitions couldn't mount.

Everything should work a lot better now. :) Hopefully update number 3 will include the ublio caching layer to speed up ntfs-3g. I'll just have to make it work first...

Brian said...

why does my 500 GB drive say it has about 486GB when plugged into the PC but only 57GB!! when pluged into the Mac?
Brian

Erik said...

Brian:
I don't know, but I think you should forward this question to the ntfs-3g developers at http://www.ntfs-3g.org, because I don't think I can do much about this. I'm just packaging the work of others so Mac users can take advantage of their work.

I have also experienced that ntfs-3g incorrectly reports free space, but it usually goes away after doing some browsing of the file system and other operations. I haven't been able to consistently reproduce the problem myself, but I have observed it.

Todd said...

Hi Erik,
First off, thanks for the great work. I appreciate all of the effort you've put in to getting this working. I've installed the latest binary from a clean install, and I'm unable to mount my Vista partition. When I try the manual mount from the command line, I receive the following error.

todd:~ toddnine$ ntfs-3g /dev/disk0s3 /Volumes/Windows
dyld: Library not loaded: /usr/local/lib/libfuse.0.dylib
Referenced from: /usr/local/bin/ntfs-3g
Reason: image not found
Trace/BPT trap

Any ideas on how to get around this?

Thanks,
Todd

Erik said...

Todd:
Seems you haven't followed instructions completely. :) You have to install MacFUSE 0.4.0 before NTFS-3G is usable. With MacFUSE 0.4.0 you should have the file /usr/local/lib/libfuse.0.dylib installed.

Todd said...

Darn, you beat me to it! I just realized my error about 10 minutes ago and installed MacFuse. Everything works great! That was a serious case of RTFM on my part :) Is there any way to change the alias to my NTFS partition? Right now I just have "disk0s3".

Todd

Erik said...

Todd: It's also a case of "package installer doesn't warn the user if MacFUSE is not installed". This issue will be fixed in the next release (i.e. it will be a requirement for installing ntfs-3g that MacFUSE is present on the system).

Your disk should have the same alias as its label, if it has a label. If it does not, it will get the diskXsY name. Give it a nice label in Windows and it will hopefully turn up in OS X. :)
Also, there's a command line utility included in the package installed at /usr/local/sbin/ntfslabel which can set the label for you. (I have never tested it myself for that purpose, but I guess it should work))

Benoit FOULETIER said...

Hi!
Just installed last version (u2), worked straight as, so yay, great work :) !

3 comments:
a) It's a pity we need to reboot, MacFuse didn't ask for reboot... but I guess there's nothing you can do about that?

b) I have folders with accents in my drive (I'm French). Before it showed up ok: "Vidéos", now it shows: "Vid?". But before I couldn't write anything and now I can so, I can't complain ;).

C) Super unimportant: the drive I'm mounting is external, and the icon changed; before it had the orange icon with usb symbol on it, now it looks like a network drive (sphere in a cube icon).

I made screenshots for all this before realizing I can't post them in comments, silly me.

Cheers!

Anonymous said...

Using the DMG files, I ust installed NTFS-3G 1.1004-u2 (after installing MacFUSE 0.4.0, and rebooting after each install) on a G4 Mac Mini running 10.4.10. My WD My Book drive (NTFS, formatted by a Windows Server 2003 system) mounted (after a bit of a delay) with the network icon on my desktop. I can read and write to it just fine, though as mentioned elsewhere, writing is very slow. (It sounds like there's a lot of disk thrashing going on when copying large numbers of small files.) I think this is great progress - if the writing performance can be improved, it'll be ready for daily use.

Rob Lewis said...

Twice now I've tried to install this and gotten a message "the software you are replacing is newer than the software you are installing." I told it to go ahead anyway, then get the message "there is nothing to install". I may have installed an earlier version of ntsf-3g, not sure. Should I be worried?

Guess I'll try uninstalling and reinstalling.

Erik said...

Rob Lewis:
I wouldn't worry too much. If it doesn't work uninstalling the previous package with the included script, then we can start worrying. :)

Anonymous said...

MacFuse 1.0 released today 27/10/2007:

http://code.google.com/p/macfuse/

with Tiger (10.4) and Leopard (10.5) versions.

Is the NTFS-3G 1.1004 pacakage compatible with MacFuse v1.0 under Tiger? Under Leopard?

If I understand the release notes comments, in Leopard, MacFuse 1.0 gets installed in /Library/Filesystems -- make a difference?

I won't install MacFuse v1.0 until a green from you.

P.S. By the way thanks for work on this project. It's much appreciated!

Erik said...

Anonymous, October 27, 2007 7:51 AM:

I haven't tested MacFUSE 1.0 or Leopard at all. You're free to test it out and tell me the results, because I guess the new MacFUSE version _shouldn't_ pose any problem (untested). :> From what I've heard about MacFUSE on Leopard, it might not display the drive correctly in the Finder.
I gotta get the ublio release out before I start worring about those things.

Erik said...

Anonymous, October 27, 2007 7:51 AM:

Oh, now I read your comment correctly. Yes, if the system folder for file systems have changed from /System/Library/Filesystems to /Library/Filesystems, then this package won't work.
If you're eager to get Leopard support working, consider buying me a copy of it so I have something to test the package with. :> I'm not that excited about it yet.

Anonymous said...

Erik wrote:
Yes, if the system folder for file systems have changed from /System/Library/Filesystems to /Library/Filesystems, then this package won't work.

Would creating a link (in old location) in 10.5 be enough to get the current package to work?

Erik said...

Anonymous, October 27, 2007 12:39 PM:

Like I said, I have no idea what works and what doesn't work in Leopard, but creating a soft link will possibly make the mount script bug out, because it tries to resolve the actual directory path from where it's situated.
Try to simply "sudo cp -R /System/Library/Filesystems/ntfs-3g.fs /Library/Filesystems".
Then it _might_ work.

Anonymous said...

Erik wrote:

Like I said, I have no idea what works and what doesn't work in Leopard...
-----
Erik, Sorry I realized too late my question was worded improperly and vague; I really meant whether a soft link might overcome (at least in theory) the different "Filesystems" locations.

Thanks for answer/tip regarding that. If I'm feeling daring I might give it a go on a backup.

neptune2000 said...

I loaded MacFuse 1.0.0 and NTFS-3G 1.1004 on a Powerbook G4.

I loaded fist with Tiger, OS X 1.4 and then withe Leopard.

In Tiger, all is well and the volumes get automatically mounted in "/Volumes/" with the name "Untitled", etc.

I removed both packages and installed Leopard. I reinstalled MacFuse 1.0.0 and NTFS-3G 1.1004. Everythig still works, except that the disks are installed with volume names "-n", "-n 1", etc.

Any idea why?

neptune2000 said...

>Oh, now I read your comment >correctly. Yes, if the system >folder for file systems have >changed >from /System/Library/Filesystems >to /Library/Filesystems, then >this package won't work.

Not a problem. In Leopard the *.fs files are still stored in /System/Library/Filesystems. There is a folder named /Library/Filesystems, but it is empty.

Erik said...

neptune2000:
Please try my latest "experimental" release for Leopard. The "-n" bug should at least be gone. :)
The experimental build (Update 4) is not dangerous to your file system unless you enable caching, and even if you do, normal usage will probably be harmless.

neptune2000 said...

I went again to the MacFuse site, and as of the 26th they have this comment in the FAQ:

"Q 2.2. How can I uninstall MacFUSE Core?

A: It depends on the MacFUSE version and the operating system version. Beginning with MacFUSE Core 0.4.0, you can use the uninstall-macfuse-core.sh script that resides in the Support subdirectory of the MacFUSE file system bundle. The bundle itself resides in /System/Library/Filesystems/ on Mac OS X 10.4.x and in /Library/Filesystems/ on Mac OS X 10.5.x."

I downloaded th Leopard package the previosu day 10/25, and it got loaded in /System/Library/Filesystems/. So maybe the following day this got changed? Weird.

The MacFUSe download page at:

http://code.google.com/p/macfuse/downloads/list


indicates that the leaopard binary was updated on Oct 26:

Uploaded by: singh
Uploaded: Oct 26 (2 days ago)
Downloads: 2696

MacFUSE-Core-10.5-1.0.0.dmg 699 KB
SHA1 Checksum: 4f6193247a72542479fc85e2633dc9726db7bf1c
Tip: Use the SHA1 checksum shown to verify file integrity.

neptune2000 said...

>neptune2000:
>Please try my >latest "experimental" release for >Leopard. The "-n" bug should at >least be gone. :)
>The experimental build (Update 4) >is not dangerous to your file >system unless you enable caching, >and even if you do, normal usage >will probably be harmless.

Sure I can try that. How do I turn on and off caching, if I may ask? The current speed is terrible, so I'd love a working cashing version.

Can I keep using the provided uninstall script for "unloading" an old version?

Erik said...

neptune2000:
Yes, the uninstall script is universal and works as long as the package is named NTFS-3G.

If you've read my latest blog post on the experimental Update 4 release, there's som text there describing how to enable caching. But I can't say that the driver is 100% safe with caching turned on.

neptune2000 said...

>If you've read my latest blog >post on the experimental Update 4 >release, there's som text there >describing how to enable caching. >But I can't say that the driver >is 100% safe with caching turned >on.

OK.

neptune2000 said...

BTW, I did veify that the "new" Leopard version loads the files in /Library/Filesystems. Therefore I will reload the 10.4 version, which loads in the old /System/Library/Filesystems

until you have changed your code to detect Leopard.

The code apparently is the same. Only the destination location is different.

neptune2000 said...

Loaded the experimental binary. I have not turned on caching. Is it me or the non-caching mode is "slower" and the Update 2?

Aaron Zhou said...

does this pakage work in Leopard?

Anonymous said...

How the hell do i get this off my computer.... all it says when I try to uninstall it is 'authorizationexecutewithprivileges failed'.... please help

psych0hans said...

Hi Erik, I am having the same problem as Todd, but I do have MacFuse installed. Infact the partitions were working perfectly up until today morning till I installed a pdf printer in windows, then it just wouldnt mount... Not sure how they're connected, but thats how it happend...

Erik said...

psych0hans (and all others):

Please don't report problems with this old version. Install the latest version and post your comments under that blog post.

You can always find the latest version here:
http://macntfs-3g.blogspot.com/search/label/Releases