Skip to content

Instantly share code, notes, and snippets.

@veltlion
Last active January 13, 2026 07:01
Show Gist options
  • Select an option

  • Save veltlion/4aaf71aaa83976a2112f0c0772cd1a5c to your computer and use it in GitHub Desktop.

Select an option

Save veltlion/4aaf71aaa83976a2112f0c0772cd1a5c to your computer and use it in GitHub Desktop.
Remount NTFS as read-write on macOS. Need macfuse and ntfs-3g-mac.
#!/bin/zsh
mount_list=$(mount | grep ntfs | grep read-only)
[ -z "$mount_list" ] && exit 0
while read line; do
device=$(echo "$line" | awk '{printf $1}')
mount_point=$(diskutil info $device | sed -En 's/ +Mount Point: +//p')
volume=$(basename "$mount_point")
sudo diskutil unmount $device || sudo umount -f $device
if [ $? = 0 ]; then
sudo ntfs-3g $device "$mount_point" \
-o local,allow_other,auto_xattr,remove_hiberfile,noatime,nodiratime,volname="$volume" && \
echo Volume "$volume" on $device mounted
fi
done <<< "$mount_list"
@veltlion
Copy link
Author

Dependencies:

brew install --cask macfuse
brew install gromgit/fuse/ntfs-3g-mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment