|
Hey Guys,
I have been trying to find it in this thread but its a bit confusing. Since the packages for NTFS-3G are currently not available I installed the whole business of MacFUSE and NTFS-3G through Fink. Now, I can do all the manual mounting but that's kinda annoying. Can someone post a quick guide as to how to create an automount on startup script for OSX? That would awesome! Thanks, Ahmed |
quote |
New Member
Join Date: Jun 2007
|
Hi, i also installed it using fink today, and have the same problem as Ahmed now...
Is there somebody who knows how shadowofged made his packages to accomplish this? I really need to know. Thanks in advance, Koen |
quote |
|
Just spent a few hours hacking together an Applescript (my first one ever)/shell script combination to help with mounting NTFS-3g drives in OS X (running 10.4.10 atm)
Here's a little background on my project. I had a drive formatted with fat32 for moving things back and forth between my lone PC and my Macs. When the urge hit to move files around, I dusted off the external drive and fired up the "sneaker net". Then the fat32 drive died on my and the only drive I had handy was an NTFS drive that had stuff on it I couldn't lose to a reformat and I didn't have space to store it anywhere else. So, to google I went. "NTFS-3G... iiiinteresting..." After many dangers, toils and snares ("can't mount DVDs?!!??! wtf!?!") I got it installed and running. Problem was, I wasn't particularly enjoying getting the drive ready to write to each time... 1) Plugin drive 2) Get drive id ("/dev/disk?s?") 3) Unmount volume 4) Launch Terminal 5) Run shell script to mount it 6) Write files to drive So... I refined my script and wrote an Applescript droplet to make things a tad easier. The new way to do it... 1) Plugin drive 2) Drop drive icon on remount scriptlet in my dock 3) Write files to drive If your NTFS drive usage habits are anything like mine, hopefully you'll find this useful. Here's a listing of my shell script and my Applescript (saved as an App) Shell Script: Code:
#/bin/sh
diskutil unmount $1
if [ ! -d "/Volumes/$2" ]
then
mkdir /Volumes/"$2"
fi
/sw/bin/ntfs-3g $1 /Volumes/"$2" -o default_permissions,volname="$2" AppleScript:Code:
property delayTime : 1
(* Whatever your "sudo" password would be *)
property myPassword : "******"
(* Naming modes: 1 - Static in script, 2 - Prompt, 3 - Use existing volume name *)
property namingMode : 3
(* For mode #1 * )
property staticVolumeName : "External"
(* This is the failover name in case a name isn't gotten *)
property staticDefault : "External"
property driveName : ""
(* Path to your script *)
property remountScript : "/bin/sh <fully qualified script path> "
on open driveicon
-- Get the volume name from parms
set driveCount to count of driveicon
-- Assume we're not gonna make it
set remountDrive to 0
set remountName to staticDefault
-- Make sure we only have one object
if driveCount is 1 then
-- Get the volume name
set driveName to item 1 of driveicon as string
-- Clean it up for use
set driveName to findAndReplace(":", "", driveName)
-- Get the device name for the shell script
set deviceName to getDeviceName(driveName)
-- What should we call it when we remount?
set remountName to getRemountDriveName()
-- Unmount the volume if required
if volumeExists(driveName) then
tell application "Finder" to eject disk driveName
set remountDrive to 1
else
display dialog driveName & ": volume not found or is unmounted already"
end if
-- Do it or not?
if remountDrive is 1 then
-- Delay just in case
delay delayTime
-- remount the drive
do shell script remountScript & "'" & deviceName & "' '" & remountName & "'" password myPassword with administrator privileges
end if
else
display dialog "This scriptlet works with only a single drive." buttons {"OK"}
end if
end open
on volumeExists(volumeName)
tell application "Finder"
if exists (disk volumeName) then
set itExists to true
else
set itExists to false
end if
end tell
return itExists
end volumeExists
on getRemountDriveName()
-- Determine drive name based on mode
if namingMode is 1 then
-- Static name
set remName to staticVolumeName
else if namingMode is 2 then
-- Prompt for name
display dialog "What name would like to mount the drive under" default answer "" buttons {"Ok"}
set remName to (text returned of result)
else if namingMode is 3 then
-- Existing Name
set remName to driveName
end if
-- Make sure there's no name clash with existing volumes (for prompted and default)
if not remName is driveName then
set inc to 1
repeat until (volumeExists(remName) is false)
set remName to remName & "-" & inc
set inc to inc + 1
end repeat
end if
-- Send back what we made
return remName
end getRemountDriveName
on findAndReplace(tofind, toreplace, TheString)
set ditd to text item delimiters
set text item delimiters to tofind
set textItems to text items of TheString
set text item delimiters to toreplace
if (class of TheString is string) then
set res to textItems as string
else -- if (class of TheString is Unicode text) then
set res to textItems as Unicode text
end if
set text item delimiters to ditd
return res
end findAndReplace
on getDeviceName(volumeName)
set previousDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
set matchingVolumes to do shell script "df | grep '/" & volumeName & "$'"
set matchingVolumes to every text item of matchingVolumes
if (count characters in item 1 of matchingVolumes) is greater than 10 then
set lastDevicePath to item 1 of matchingVolumes
end if
set AppleScript's text item delimiters to previousDelimiters
return lastDevicePath
end getDeviceName To use the shell script, just add the text (I used vi) to a file (in my case .mount_script.sh) and change permissions.To use the AppleScript, cut and paste the code into the Script Editor and save it as an application. Some notes on the Shell Script... 1) Don't forget to run chmod +x on it to make it executable. I personally hid it in my User folder with a "." in front of the name. 2) Change your parms for the ntfs-3g call to suite your purposes. I was having privilege issues until I used default_permissions. At this point I don't pretend to know the implications of using it, but I can write files with it. Good enough for now. Some notes on the AppleScript... 1) It has three naming modes for remounting; 1: Use a hardcoded volume name, 2: Prompt for a name, 3: Use existing volume name. I started using the script initially in mode 1, but have since started using mode 3. I haven't used mode 2 more than just enough to test. I did make a half-hearted attempt to make sure volume names weren't duplicated. If you use mode 2 (for example) and use an existing volume name, it'll add a '-#' to it and keep trying til it gets one not in use. 2) I hacked together a number of examples I've found on the web to build the script. "findAndReplace" I used wholesale (http://bbs.applescript.net/viewtopic.php?id=13008). 3) I discovered (possibly even on this site) you can't make "do shell script" calls "with administrator privileges" within a tell block (in this case I had it in a tell application "finder" block). If you get the urge to revamp things, keep that in mind. I should really put more time into error trapping but as it is I've spent hours on the whole NTFS-3G initiative. I've run chkdsk /f on my NTFS drive more times than I can count. If anyone has any tweaks that will improve it I'd be interested to see 'em. Enjoy! |
quote |
|
Thank you all for helping me get this going. I have put a compiled version with help text and everything but XCode at the following URL:
http://www.mrmays.com/ntfs-3g/NTFS-OSX-PPC-10.4.zip It goes without saying that my small contribution is all GPL and everyone should use it everywhere! Thank you again, Steve Mays |
quote |
New Member
Join Date: Jun 2007
|
Ahmed, i found out how to do it. I wrote a tutorial here:
http://forums.applenova.com/showthre...042#post479042 It should be quite simple to do. Let me know! Greetings Koen |
quote |
|
Quote:
Ahmed |
|
quote |
Veteran Member
Join Date: Mar 2005
Location: Near Indianapolis
|
Oh, this is fun. Macworld printed a link to NTFS-3G in the August 2007 issue (I just got it in the mail today). The only problem is, the link redirects to Shadow Of Ged's iDisk, and he's taken the file down.
|
quote |
|
Hi everyone...
I managed to download the DMG file for MacFUSE 0.4.0 and installed it but have no idea where to get the NTFS-3G file. I saw someone mention they used Fink so I downloaded it and tryed to install it that way and it says no package found... Does anyone have the DMG file for the latest version of ntfs-3g for mac os x or know how I can get it and install it? I appreciate any help. Thanks |
quote |
New Member
Join Date: Feb 2007
|
|
quote |
Sneaky Punk
|
Just change the extension of the file manually.
|
quote |
Member
|
Select 'Make plain text' from the 'Format' menu. Just changing the extension to .txt won't make the file a text file.
|
quote |
New Member
Join Date: Feb 2007
|
Quote:
how do i execute that file? i just tried the first line (unmount) and saved it as ntfs_unmount.command, then i opened it with terminal but nothing happend. everything went fine when i open the terminal itself and type the first line in it... |
|
quote |
Member
|
backslash,
Quick answer: open a terminal and type Code:
chmod +x file.command That will set a text file as executable, allowing Terminal to run it.Long answer: You should really look up how unix permissions work. It's great that you're starting to use the command line and I recommend finding a tutorial of some sort for an overview of using Terminal. If you have any more questions about unix or scripting rather than NTFS-3G specifically, feel free to PM me rather than posting to this discussion. |
quote |
|
hi
I was wondering how I can find (using Applescript or the Terminal) what partition type a volume has? eg. I would like to find out whether a Volume is HFS+ , NTFS etc formatted.. if I would be able to even find out whether it was mounted using ntfs-3g or without, that would be awesome! Would appreciate any help! thx in advance |
quote |
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
Quote:
If you're just curious what type a volume is, you can do a Get Info on the volume in Finder. Otherwise, the best way *I* know is just to run the following on the terminal: That will tell you the type of filesystem used to mount a given volume. If you want more info, just leave off the "| sed …" portion at the end. Hope this helps. Apparently I call the cops when I see people litter. |
|
quote |
|
Hi,
I recently bought a MAC and having the same above mentioned problem. I am not able to write data onto the NTFS external drive. I installed the MAC FUSE but couldnt find the ntfs-3g driver. I used the above given URLs but they were gving an error called unable to mount device. Can you please tell me what should I do. Thanks, Mehul |
quote |
Posting Rules | Navigation |
Page 13 of 13 First Previous 9 10 11 12 [13] |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Firefox 2.0 for Mac: User Interface Grievances (Redux!) | Brad | Third-Party Products | 42 | 2006-11-06 13:33 |
Stupid Mac graphics card options | Luca | Third-Party Products | 33 | 2005-07-01 01:34 |
Games specifically for Mac | Banana | General Discussion | 24 | 2005-03-28 14:03 |
Of All Things: PowerMac vs. Mac mini?!?!? | Wraven | Purchasing Advice | 20 | 2005-01-25 21:25 |
Apple releases updated Power Mac G5s | staph | Apple Products | 43 | 2004-06-09 13:20 |