This page has been robot translated, sorry for typos if any. Original content here.

How to enable NTFS write support on Mac OS X 10.7 Lion using standard tools

On this topic:


Как включить поддержку записи NTFS в Mac OS X 10.7 Lion стандартными средствами


After installing Mac OS X 10.7, Lion Golden Master began to look closely at the future working environment: what and how it works, what they removed, what they added, what they moved. This is almost what awaits us just about! I decided to try out how things are with reading / writing NTFS in Lion. Reading, of course, works like that, as they say “out of the box”, but I decided to shamanize with the inclusion of writing to NTFS partitions using the available tools of the “Lev” operating system. I decided to do this business myself, and it gave a positive result.

By the method of scientific poking (folk methods do not sign in trifles) I determined that everything is okay with the mount_ntfs binar in the / sbin folder, the script that we create also works as it should. It turned out that the whole thing was covered in the ntfs.kext driver itself (located in / System / Library / Extensions / . Having drunk a bit in NTFS drivers from Mac OS X 10.6.8 and from Mac OS X 10.7, GM found that the drivers are minimally different, you can say only the assembly, but Lion was flashed with built-in support for writing to NTFS partitions. I tried to slip the ntfs.kext kekst binaric from Snow Leopard into Lion, treated the rights, rebooted ... And it worked! In short, the instruction:

Download this archive , which contains the binarik from ntfs.kext from Mac OS X 10.6.8 Snow Leopard and a script. Unpack this archive on the desktop. You should have an NTFS_Enabler folder in which there are two files: mount_ntfs and ntfs . Launch the Terminal ( Terminal.app ) and execute:

1) In order not to write unnecessary sudo, we immediately say that we will work on behalf of the administrator (root): sudo -s and press Enter. To request a password, enter the superuser password and press Enter again.

2) Create a backup of the binarik from ntfs.kext : mv /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs_orig
mv /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs_orig

3) Copy the ntfs.kext binaric driver, drawn from Mac OS X 10.6.8 Snow Leopard, to the original binaric: cp ~/Desktop/NTFS_Enabler/ntfs \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs
cp ~/Desktop/NTFS_Enabler/ntfs \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs

4) Assign the correct rights and attributes to it: chown root:wheel /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs;\
chmod 644 /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs
chown root:wheel /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs;\
chmod 644 /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs

5) Create a backup of the original mount_ntfs daemon: mv /sbin/mount_ntfs /sbin/mount_ntfs_orig

6) Now, in place of the original mount_ntfs daemon, we put a script wrapper that will “intercept” system commands and activate ntfs.kext for reading and writing: cp ~/Desktop/NTFS_Enabler/mount_ntfs /sbin/mount_ntfs

7) Assign the correct rights and attributes to the copied script: chown root:wheel /sbin/mount_ntfs; chmod 755 /sbin/mount_ntfs chown root:wheel /sbin/mount_ntfs; chmod 755 /sbin/mount_ntfs

8) Launch the driver: kextload /System/Library/Extensions/ntfs.kext If it starts successfully, there should be no errors.

9) Run the Disk Utility and remount disks with the NTFS file system. There is no need to reboot.

The archive also contains a text document with the commands line by line, as the blog engine could shake some of them. After completing the above 9 steps, disks and partitions with the NTFS file system will be mounted for reading and writing immediately, without any “registration” in fstab and reboots! You can disable NTFS recording and return everything using two console commands (you will need an administrator password):
sudo mv /sbin/mount_ntfs_orig /sbin/mount_ntfs then sudo mv /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs_orig \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs
sudo mv /System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs_orig \
/System/Library/Extensions/ntfs.kext/Contents/MacOS/ntfs

Pros and Mniuses:

Pros:

  • High write speed, about 30 MB / s.
  • When deleting files, puts them in the trash, and does not permanently delete them.

Minuses:

  • If the volume is "incorrectly" mounted from Windows, it swears at the log and mounts read-only.
  • Disk Utility cannot create an NTFS partition.
  • Well, it's still a hack ;-)

Therefore, readers have the following recommendation: by default, use the native driver according to this method. But Keep NTFS-3G installed but turned off (the Disable / Enable button in System Preferences) in case you need to mount a problem partition or partition a disk. I’ll also remind myself that everything has been tested and works from Mac OS X Lion 10.7 Golden Master to Mac OS X Lion 10.7.2 inclusive.

Do not use NTFS to store important files when working on Mac OS X; conversely, do not use HFS + to store important files when working on Windows. Do not rely on third-party solutions such as Tuxera NTFS, Paragon NTFS or NTFS-3G. Use the NTFS write function only for sharing files whose loss is not critical, or if there is a backup.

Attention! Due to numerous inconsistencies, I created a small package called NTFS Tools , which will do everything described above automatically.