📜 ⬆️ ⬇️

Mount NTFS disks for writing in MacOS X 10.9 Mavericks

It took me the other day to backup (about 75 gigabytes of different files) to an external hard drive, but bad luck - it was formatted in the NTFS file system - it seems that other operating systems have been writing to it for a long time without any problems, and in MacOS I had to use “my solution” .

And so, having studied what google offers me, it turned out that I had to buy either Paragon NTFS, or Tuxera NTFS, or use a free solution.

After a series of experiments, it turned out that the easiest way is to install the ntfs-3g package from MacPorts and replace / sbin / mount_ntfs
')
The port system of MacPorts was installed long ago (I used mc, wget and other useful utilities that I used in Linux, such as pwgen, for example).

It does not exist on a clean system — hence, it must be installed according to the instructions on www.macports.org — download and run the installation script.

Next, install osxfuse and ntfs-3g

sudo port install osxfuse ntfs-3g

And so that there was full automation, that is, the media was automatically mounted (rather than manually) replacing mount_ntfs

sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
sudo vi /sbin/mount_ntfs

 #!/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 /opt/local/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/ntfsmnt.log exit $?; 


sudo chmod +x /sbin/mount_ntfs

Known issues:
- It remains /Volumes/[label.fm/.Trashes and mounts it a second time in [label 2] and you have to delete folders manually, opened a bug on osxfuse github.com/osxfuse/osxfuse/issues/139

Script Source: fernandofig.wordpress.com/2011/08/08/ntfs-write-support-on-osx-lion-with-ntfs-3g-f

Source: https://habr.com/ru/post/225153/


All Articles