Created
April 15, 2026 09:33
-
-
Save dubiao/3fbf68ef2a2bff0466321395f8ddc6e7 to your computer and use it in GitHub Desktop.
Mount NTFS drives as writable on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$1" = "-d" ] ; then | |
| dev=$2 | |
| volume=$3 | |
| diskutil info $dev|grep NTFS>/dev/null | |
| if [ $? -ne 0 ] ; then | |
| echo "The recently mounted disk: $dev is not an NTFS disk! Press Return to exit" | |
| read | |
| else | |
| diskutil umount $volume>/dev/null | |
| echo "Please enter the password for user ${USER}" | |
| sudo mkdir $volume | |
| sudo mount -t ntfs -o rw,auto,nobrowse $dev $volume>/dev/null 2>&1 | |
| if [ $? -ne 0 ] ; then | |
| echo "The disk needs to be checked and repaired on Windows before it can be mounted as writable!" | |
| echo "Press Return to exit" | |
| sudo umount $volume>/dev/null 2>&1 | |
| sudo rm -r $volume | |
| read | |
| exit | |
| fi | |
| open $volume | |
| echo "Press Return to unmount $volume" | |
| read | |
| until sudo umount $volume | |
| do | |
| echo "Please close any programs using $volume, then press Return to unmount $volume" | |
| read | |
| done | |
| fi | |
| else | |
| N=1 | |
| `echo df`| while read myline | |
| do | |
| N=`expr $N + 1` | |
| if [ $N -gt 2 ] ; then | |
| dev=$myline | |
| volume=`echo ${dev##*% }|sed 's/\ /\\\ /g'` | |
| dev=${dev%% *} | |
| echo "~/ntfs.sh -d ${dev} ${volume}" | |
| fi | |
| done | |
| echo "Copy the command line for the disk you want to mount. Remember to come back here to unmount before ejecting." | |
| echo "~/ntfs.sh is the path to the script. -d is the execution flag." | |
| fi | |
| exit |
Author
Author
You can also install Mounty.
Run these three commands:
brew install --cask macfuse
brew install gromgit/fuse/ntfs-3g-mac
brew install --cask mountyMounty version 2 now acts as a graphical user interface for the third-party driver NTFS-3G. This brings NTFS write support back to macOS, but the installation is now a bit more complex. You need two additional pieces of software to use with Mounty 2: macFUSE and NTFS-3G for Mac.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Failure to mount an NTFS disk is usually caused by the disk being in a "hibernation" or "dirty" state due to not being safely removed on Windows.
Typical fix:
Connect it back to a Windows PC and safely eject it, or repair it using chkdsk:
(Replace X with the actual drive letter of your hard disk.)
Even this may not always work. Just make do with it for now.