DEV Community

zankyr
zankyr

Posted on • Updated on

Make NTFS writable again (on OSX)

Long story short: NTFS is a proprietary filesystem, owned by Microsoft. And thanks to this, all the NTFS formatted hard drives are read-only on a OSX OS.

Following you can find instructions on how to make NTFS writable again, depending on your operating system.

Ventura (13.0.1)

Good news everyone!
It is now possible to re-enable the NTFS writing.

No more talk (really, the Italian "bando alla ciance" is way better).

Step 0: Homebrew should be installed.

Step 1: Update Xcode via Terminal:

$ xcode-select --install
Enter fullscreen mode Exit fullscreen mode

Step 2: Install osxfuse via Homebrew

$ brew install --cask osxfuse
Enter fullscreen mode Exit fullscreen mode

Step 3: Install NTFS-3G from Homebrew

brew tap gromgit/homebrew-fuse
brew install ntfs-3g-mac
Enter fullscreen mode Exit fullscreen mode

Step 4: Change the mount location for your drive

First list all the mounted drives:

diskutil list
Enter fullscreen mode Exit fullscreen mode

Take note of the name of the drive you want to make readable. In our example we'll use disk2s2:
diskutil example

Unmount the drive:

sudo diskutil unmount /dev/disk2s2
Enter fullscreen mode Exit fullscreen mode

Create a new volume directory:

sudo mkdir /Volumes/NTFSDrive
Enter fullscreen mode Exit fullscreen mode

Mount your drive to new newly created folder:

sudo /usr/local/sbin/mount_ntfs /dev/disk2s2 /Volumes/NTFSDrive
Enter fullscreen mode Exit fullscreen mode

Open the drive:

open /Volumes/NTFSDrive/
Enter fullscreen mode Exit fullscreen mode

Monterey (12.2.1)

Due to several security changes introduced in the previous versions (Big Sur or maybe Catalina), the operations described in this post no longer work.
I'll update this section as soon as I'll discover a working workaround.

Mojave (10.14.6)

Step 0: Homebrew should be installed.

Step 1: Update Xcode via Terminal:

$ xcode-select --install
Enter fullscreen mode Exit fullscreen mode

Step 2: Disable the System Integrity Protection (SIP).
Reboot your Mac, and when the boot screen appears (the one with the Apple logo), press CMD+R, and go into recovery mode.
Once here, open the terminal from the menu' bar and execute the following command.

$ csrutil disable
Enter fullscreen mode Exit fullscreen mode

If the operation is successful, reboot the machine.

Step 3: Install osxfuse via Homebrew

$ brew install --cask osxfuse
Enter fullscreen mode Exit fullscreen mode

Reboot.

Step 4: Install ntfs-3g
The original Homebrew formulae has been disabled since it was not open-source software (you can find the entire motivation in the links at the end of the page).

You can use a fork made by an user:

brew install darelover/ntfs-3g/ntfs-3g
Enter fullscreen mode Exit fullscreen mode

Guess what? Reboot again.

Step 5: Mount point
First, backup the original mount file:

$ sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
Enter fullscreen mode Exit fullscreen mode

Now, create the new mount file:

sudo ln -s /usr/local/sbin/mount_ntfs /sbin/mount_ntfs
Enter fullscreen mode Exit fullscreen mode

Note: /usr/local/sbin/mount_ntfs should be a symbolic link to the folder created by ntfs-3g. Usually its path should be /usr/local/Cellar/ntfs-3g/<version_number>/sbin

Step 6: Check
Attach your hard drive. If you're lucky, everything should be working fine.

But you can notice that in the Finder the files are not visible, you can see only folders (via Terminal you should see the entire filesystem correctly).

If you are unlucky, follow this step.
Using the Terminal, go in the ntfs-3g folder, make a backup of the mount_ntfs file and create a new one:

$ cd /usr/local/Cellar/ntfs-3g/<version_number>/sbin
$ sudo mv mount_ntfs mount_ntfs.orig
$ sudo nano mount_ntfs
Enter fullscreen mode Exit fullscreen mode

Copy the following script in the new file you've just created:

#!/bin/bash
VOLUME_NAME="${@:$#}"
VOLUME_NAME=${VOLUME_NAME#/Volumes/}
USER_ID=501
GROUP_ID=20
TIMEOUT=20
if [ `/usr/bin/stat -f "%u" /dev/console` -eq 0 ]; then
        USERNAME=`/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow | /usr/bin/grep autoLoginUser | /usr/bin/awk '{ print $3 }' | /usr/bin/sed 's/;//'`
        if [ "$USERNAME" = "" ]; then
                until [ `stat -f "%u" /dev/console` -ne 0 ] || [ $TIMEOUT -eq 0 ]; do
                        sleep 1
                        let TIMEOUT--
                done
                if [ $TIMEOUT -ne 0 ]; then
                        USER_ID=`/usr/bin/stat -f "%u" /dev/console`
                        GROUP_ID=`/usr/bin/stat -f "%g" /dev/console`
                fi
        else
                USER_ID=`/usr/bin/id -u $USERNAME`
                GROUP_ID=`/usr/bin/id -g $USERNAME`
        fi
else
        USER_ID=`/usr/bin/stat -f "%u" /dev/console`
        GROUP_ID=`/usr/bin/stat -f "%g" /dev/console`
fi

/usr/local/opt/ntfs-3g/bin/ntfs-3g \
         -o volname="${VOLUME_NAME}" \
         -o local \
         -o negative_vncache \
         -o auto_xattr \
         -o auto_cache \
         -o noatime \
         -o windows_names \
         -o user_xattr \
         -o inherit \
         -o uid=$USER_ID \
         -o gid=$GROUP_ID \
         -o allow_other \
         "$@" &> /var/log/mount-ntfs-3g.log

exit $?;
Enter fullscreen mode Exit fullscreen mode

Save the file, save the world.

Change the file's permissions:

$ sudo chmod 555 mount_ntfs
Enter fullscreen mode Exit fullscreen mode

Remove and then reconnect your disk, et-voila'!.

Yosemite (10.10) and El Capitain (10.11)

Step 0 - ONLY FOR EL CAPITAIN: Disable the System Integrity Protection (SIP).

Reboot your Mac, and when the boot screen appears (the one with the Apple logo), press CMD+R, and go into recovery mode.
Once here, open the terminal from the menΓΉ bar and execute the following command.

$ csrutil disable
Enter fullscreen mode Exit fullscreen mode

If the operation is successful, reboot the machine.

Step 1: Install osxfuse

Download osxfuse and install it. Flag all the provided options when requested.
Once the installation is finished, reboot the machine.

Step 2: Install ntfs-3g

Download and install ntfs-3g. Unfortunately this application is no longer maintained, but this version is still enough for our purposes.
When asked, check the option nocaching.

On El Capitain an error message could be displayed at the end of the installation process. Just ignore it.

Reboot the system.

Step 3: Download and install fuse-wait.

Step 4: Attach your hard drive and check that the disk is writable.

Step 5 - ONLY FOR EL CAPITAIN: Re-enable the SIP
Repeat the step 1, but now execute this command:

$ csrutil enable
Enter fullscreen mode Exit fullscreen mode

If the operation is successful, reboot the machine.

Useful links

Homebrew: https://brew.sh/
ntfs-3g original formulae: https://formulae.brew.sh/formula/ntfs-3g#default
Why ntfs-3g formulae has been disabled: https://github.com/Homebrew/homebrew-core/pull/64491

Thanks to

https://wpbeaches.com/how-to-write-to-windows-ntfs-usb-disk-drives-on-macos-macos-mojave-and-sierra/

https://gist.github.com/takeit/9fa83840f3b2065e204dc9d52cef3693

https://github.com/darelover/homebrew-ntfs-3g

https://github.com/osxfuse/osxfuse/issues/574

http://www.macbreaker.com/2014/06/how-to-enable-writing-to-ntfs-hard.html

https://techsviewer.com/how-to-write-ntfs-drives-on-macos-ventura/

Top comments (0)