Changes between Initial Version and Version 1 of howto/Ntfs3gFinder


Ignore:
Timestamp:
Mar 7, 2014, 9:28:09 PM (10 years ago)
Author:
mf2k (Frank Schima)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/Ntfs3gFinder

    v1 v1  
     1These 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].
     2
     3=== Step 1. Install the ntfs-3g port. ===
     4{{{
     5sudo port install ntfs-3g
     6}}}
     7
     8=== Step 2. Find out your userid and groupid. ===
     9User ID:
     10{{{
     11id -u
     12}}}
     13Group ID:
     14{{{
     15id -g
     16}}}
     17
     18=== Step 3. Use a modified mount_ntfs executable and save the OS X original to {{{/sbin/mount_ntfs.orig}}} ===
     19{{{
     20sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
     21sudo touch /sbin/mount_ntfs
     22sudo chmod 0755 /sbin/mount_ntfs
     23sudo chown 0:0 /sbin/mount_ntfs
     24sudo nano /sbin/mount_ntfs
     25}}}
     26
     27Then paste in the following code and save it by typing Control-X and pressing "Y". NOTE:
     28  - 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.
     29  - This script also assumes the standard Macports install location of {{{/opt/local/}}} so you will need to modify it if yours is different.
     30
     31{{{
     32#!/bin/bash
     33VOLUME_NAME="${@:$#}"
     34VOLUME_NAME=${VOLUME_NAME#/Volumes/}
     35USER_ID=501
     36GROUP_ID=20
     37TIMEOUT=20
     38if [ `/usr/bin/stat -f "%u" /dev/console` -eq 0 ]; then
     39        USERNAME=`/usr/bin/defaults read /library/preferences/com.apple.loginwindow | /usr/bin/grep autoLoginUser | /usr/bin/awk '{ print $3 }' | /usr/bin/sed 's/;//'`
     40        if [ "$USERNAME" = "" ]; then
     41                until [ `stat -f "%u" /dev/console` -ne 0 ] || [ $TIMEOUT -eq 0 ]; do
     42                        sleep 1
     43                        let TIMEOUT--
     44                done
     45                if [ $TIMEOUT -ne 0 ]; then
     46                        USER_ID=`/usr/bin/stat -f "%u" /dev/console`
     47                        GROUP_ID=`/usr/bin/stat -f "%g" /dev/console`
     48                fi
     49        else
     50                USER_ID=`/usr/bin/id -u $USERNAME`
     51                GROUP_ID=`/usr/bin/id -g $USERNAME`
     52        fi
     53else
     54        USER_ID=`/usr/bin/stat -f "%u" /dev/console`
     55        GROUP_ID=`/usr/bin/stat -f "%g" /dev/console`
     56fi
     57
     58/opt/local/bin/ntfs-3g \
     59         -o volname="${VOLUME_NAME}" \
     60         -o local \
     61         -o negative_vncache \
     62         -o auto_xattr \
     63         -o auto_cache \
     64         -o noatime \
     65         -o windows_names \
     66         -o user_xattr \
     67         -o inherit \
     68         -o uid=$USER_ID \
     69         -o gid=$GROUP_ID \
     70         -o allow_other \
     71         "$@" &> /var/log/ntfsmnt.log
     72
     73exit $?;
     74}}}