Skip to content

Instantly share code, notes, and snippets.

@pansapiens
Last active May 30, 2018 05:39
Show Gist options
  • Save pansapiens/d2c4910aee86a9ffe1c4dec2d647de4c to your computer and use it in GitHub Desktop.
Save pansapiens/d2c4910aee86a9ffe1c4dec2d647de4c to your computer and use it in GitHub Desktop.
#!/bin/bash
# A simple script for mounting NTFS disks on macOS
if [ $# -eq 0 ]; then
diskutil list
echo
echo "No arguments provided."
echo "Usage: mount-ntfs.sh [diskXsY]"
echo "eg: mount-ntfs.sh disk2s2"
echo
echo "Note: ntfs-3g FUSE driver must be installed:"
echo "xcode-select --install && brew install ntfs-3g"
exit 1
fi
sudo true
DISK=$1
if [ ! -d /Volumes/$DISK ]; then
sudo mkdir /Volumes/$DISK
fi
sudo /usr/local/bin/ntfs-3g /dev/$DISK /Volumes/$DISK -olocal -oallow_other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment