Wednesday, August 27, 2008

NTFS on Mac OSx using Mac Fuse and NTFS 3G

When I switched over to using a Mac it was because my PC had crashed. Two of the disks survived though, and now I wanted to mount them on my mac to salvage some documents, and use of of the disks as a backup disk for my mac book pro.

I got an IceBox to mount the drive, and hooked it up using USB. This worked like a charm, and I could access my documents. But hey - the NTFS driver on Leopard does not support write! My idea was to first clean out all the garbage from the disk and then copy it to my Mac (the disk is larger than the internal one). Crap!

Googled and found the cure - use Mac Fuse, an umbrella for plugging in support for various file system types, and NTFS-3g, a driver for Mac Fuse that support both reading and writing.

I found this blog-post how to do this.

First download and install Mac Fuse, then download a NTFS-3G as instructed in this blog-post.

Again everything worked fine - Except - it failed to mount one of the partitions on my disk because apparently I did not shut down the NTFS properly before installing NTFS-3G (merde).

This was a bit tricky to fix. An error message appears with instructions, but they are not accurate. Basically what is needed is a mount with "-o force" to make it clear the "unclean shutdown".

Googled, and found the answer in this forum. To get rid of the problem you need to do two things:

Create the directory where the drive is to be mounted by opening a Terminal window and typing:

mkdir -p /Volumes/C-DRIVE

Where C-DIRVE is the name of the volume, and then forcing it to be mounted by typing (all on one line):
sudo /usr/local/bin/ntfs-3g /dev/disk1s1 /Volumes/C-DRIVE
-olocale=en_US.UTF-8,force,auto_xattr,defer_auth,defer_permissions,volname="C-DRIVE"

Where C-DRIVE is the name of the volume. and "/dev/disk1s1" is the device name as shown in the error message displayed by NTFS-3G.

In my case this produced an error, as apparently /Volumes/C-DRIVE was already inside an ntfs-3g mounted partition (there are two partitions on my drive), but it did at least tell me that it cleared the Log File.

After this, it worked find to just eject the drives, and plug in the USB cable - no need to run the commands again. But I guess they will come in handy when there is an unclean shutdown sometime in the future....

No comments: