[MacPorts] howto/Ntfs3gFinder added

MacPorts noreply at macports.org
Fri Mar 7 13:28:11 PST 2014


Page "howto/Ntfs3gFinder" was added by macsforever2000 at macports.org
Content:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
These instructions have been liberally copied [http://fernandofig.wordpress.com/2011/08/08/ntfs-write-support-on-osx-lion-with-ntfs-3g-f/ from this excellent blog post]. 

=== Step 1. Install the ntfs-3g port. ===
{{{
sudo port install ntfs-3g
}}}

=== Step 2. Find out your userid and groupid. ===
User ID:
{{{
id -u
}}}
Group ID:
{{{
id -g
}}}

=== Step 3. Use a modified mount_ntfs executable and save the OS X original to {{{/sbin/mount_ntfs.orig}}} ===
{{{
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
sudo touch /sbin/mount_ntfs
sudo chmod 0755 /sbin/mount_ntfs
sudo chown 0:0 /sbin/mount_ntfs
sudo nano /sbin/mount_ntfs
}}}

Then paste in the following code and save it by typing Control-X and pressing "Y". NOTE:
  - You can optionally substitute in your User ID and Group ID (from Step 2 above) in place of 501 and 20 in lines 4 and 5 below. 
  - This script also assumes the standard Macports install location of {{{/opt/local/}}} so you will need to modify it if yours is different. 

{{{
#!/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 $?;
}}}

-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/Ntfs3gFinder>
MacPorts <http://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'howto/Ntfs3gFinder' page.
If it was not you, please report to .


More information about the macports-changes mailing list