YAMAGUCHI::weblog

海水パンツとゴーグルで、巨万の富を築きました。カリブの怪物、フリーアルバイター瞳です。

Mac OS XでNTFSのディスク読み書きを行う

動機

MacでNTFSの外付けHDDのデータを読み書きする必要が出てきた。

方法

NTFS-3Gを使います。通常の方法でマウントすると、NTFSのディスクは読み取り専用となってしまいます。
f:id:ymotongpoo:20090521004747p:image
そこでNTFS-3Gをインストール。

自分はMacPortsを使っているのでそこからインストールすることにします。

$ port search ntfs-3g
ntfs-3g @1.5130 (fuse)
    Safe read/write NTFS driver for FUSE
$ sudo port install ntfs-3g
--->  Fetching macfuse
--->  Attempting to fetch macfuse-1.7-1.tar.bz2 from http://distfiles.macports.org/macfuse
--->  Verifying checksum(s) for macfuse
--->  Extracting macfuse
--->  Applying patches to macfuse
--->  Configuring macfuse
--->  Building macfuse
--->  Staging macfuse into destroot
Warning: macfuse requests to install files outside the common directory structure!
--->  Installing macfuse @1.7_1
--->  Activating macfuse @1.7_1
--->  Cleaning macfuse
--->  Fetching ntfs-3g
--->  Attempting to fetch ntfs-3g-1.5130.tgz from http://distfiles.macports.org/ntfs-3g
--->  Verifying checksum(s) for ntfs-3g
--->  Extracting ntfs-3g
--->  Configuring ntfs-3g
--->  Building ntfs-3g
--->  Staging ntfs-3g into destroot
--->  Installing ntfs-3g @1.5130_0
--->  Activating ntfs-3g @1.5130_0
--->  Cleaning ntfs-3g

インストールが終わったらマウントポイントを作成し、ntfs-3gコマンドを使ってマウント。

$ mkdir /Volumes/ntfs
$ sudo ntfs-3g /dev/disk1s1 /Volumes/ntfs -o volname="HD-PFU2",force,auto_xattr,defer_auth,defer_permissions
Password:
kextload: /System/Library/Filesystems/fusefs.fs/Support/fusefs.kext loaded successfully

するとこんな具合にマウントされます。
f:id:ymotongpoo:20090521010357p:image
ほら、ちゃんと読み書きできます。
f:id:ymotongpoo:20090521010504p:image

補足

なお、rootユーザでないとこんな警告がでます。

$ ntfs-3g /dev/disk1s1 /Volumes/ntfs/ -ovolname="HD-PFU2"
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at
http://ntfs-3g.org/support.html#unprivileged

補足2

マウントしたはいいんだけど、めちゃめちゃ重いです。16GBのVMwareのイメージをバックアップとるためにコピーしようと思ったらこのざまです。
f:id:ymotongpoo:20090521012735p:image
調べてみても結構「書き込みが遅い」というようなコメントがあるので、ちょっとしたファイルのやりとりぐらいにしか使えないのでしょうかね。