Install NTFS-3G in MacOS Mojave
We live surrounded of different OS environments. Sometimes is difficult to find the tools to coexist with the same applications, or workflow, in different systems. In this case, to manage the storaging devices, the most easy way is to use exFAT format. But there are devices that just recognize FAT32 or NTFS filesystems. Out-of-the-box, Mac OS systems just recognize NTFS devices for reading, but you are not allowed to write into the devices.
So, in this article you will learn the required steps for jump over all the security measures of MacOS for being able to write into a NTFS filesystem.
1. Disable the System Integrity Protection
For protecting you against the bad guys, Apple protects the core of the system and do not allow to any user to write files in certain locations. This protection also affects to the device mounting tools. So, as the overriding of the mount_ntfs tool is required, this protection must be disabled just a moment.
So, firstly, reboot your system and hold the CMD R S keys for entering in the Single User Recovery mode. A lot of lines of logs will be displayed, just wait a moment until you are able to write something. Then, write the first command for disabling the System Integrity Protection, and the second command for rebooting the system.
$ csrutil disable
$ reboot
Login as usual in the system.
2. Installing tools
Homebrew [1] is a nice and easy tool for installing software in your system. You can automatize all your computer setup with just a call to a bash script if you have time to learn how to (there are some examples on the Internet). Then, the next step is to install this tool and use it for downloading and install Fuse and NTFS-3G, which are the tools that will allow our system to mount NTFS devices.
## Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
##Install Fuse and NTFS-3G
$ brew cask install osxfuse
$ brew install ntfs-3g
3. Linking files
After all tools are installed, it is time to replace the mount_ntfs tool from MacOS. The following commands save a backup of the mount_ntfs tool from the system, and create a new symbolic link to the tool that you have just installed.
$ sudo mv "/Volumes/Macintosh HD/sbin/mount_ntfs" "/Volumes/Macintosh HD/sbin/mount_ntfs.orig"
$ sudo ln -s /usr/local/sbin/mount_ntfs "/Volumes/Macintosh HD/sbin/mount_ntfs"
You will find the same explanation in the tool's GitHub repository. But there are many more details that maybe are not significant in this case.
4. Allow execute software from 3th parties
At High Sierra version, Apple has hidded the option to allow software of non-signed developers. It is a pain in the ass to those all Open Source tools that cannot afford to pay the developer's tax for publishing software.
However, this option is not removed, with the following command you will be able to see again the option for allowing this kind of software at the "System Preferences > Security & Privacy > General" window.
$ sudo spctl --master-disable
5. Enable the System Integrity Protection
Just follow the previous steps for bringing back again the Apple's System Integrity Protection: reboot your system and hold the CMD
R
S
keys for entering in the Single User Recovery mode and wait to the bash prompt.
$ csrutil enable
$ reboot
Notes
System freezing on permission dialog shown
If you rebooted your system after linking the mount_ntfs tool, the system will get freezed if you push over a dialog that is displayed asking you permission for executing Fuse and NTFS 3G. For avoiding this, you have to disable the System Integrity Protection and complete all the tutorial.
Restore default mounting tool
If you want to remove the tools that I propose you in this tutorial, you have to:
- Disable the System Integrity Protection.
- Execute the following commands:
$ sudo rm "/Volumes/Macintosh HD/sbin/mount_ntfs" $ sudo mv "/Volumes/Macintosh HD/sbin/mount_ntfs.orig" "/Volumes/Macintosh HD/sbin/mount_ntfs" $ brew uninstall fuse ntfs-3g --purge
- Enable again the System Integrity Protection.
References
[1] "Homebrew", https://brew.sh/
[2] "GitHub", https://github.com/osxfuse/osxfuse/wiki/NTFS-3G