User Name
Password
AppleNova Forums » Third-Party Products »

Tutorial: How to automount a ntfs partition read/write using ntfs-3g


Register Members List Calendar Search FAQ Posting Guidelines
Tutorial: How to automount a ntfs partition read/write using ntfs-3g
Thread Tools
koen
New Member
 
Join Date: Jun 2007
 
2007-07-03, 06:07

In this tutorial i will explain my method to automount your ntfs partition using ntfs-3g. There were packages which did this for you (made by shadowofged), but as many of you might know, (almost) all links to them are dead. But thankfully I have found a workaround to automount your disk (A).

NOTE: This will only work with disks that are already connected at boot-time.
You will need macFuse Core installed (download it here and ntfs-3g (i would recommend to compile it on you own using xCode and this tutorial. I do not garranty if it works with precompiled ntfs-3g stuff)
Following this tutorial is completely at your own risk! (though i consider it quite safe)


Now lets begin with the tutorial!
First we make a little shell-script which does all the steps for mounting the disk. Make a plain text document with this commands inside:

Quote:
#!/bin/bash

/usr/sbin/diskutil unmount /dev/disk0s1
/bin/mkdir /volumes/data
/sw/bin/ntfs-3g /dev/disk0s1 /volumes/data -o volname=Data
save it as "ntfs_mount.command" in "/ntfs_mount" or where-ever you like.
to make "ntfs_mount.command" executable, go into terminal. browse to the folder where you saved it, and do
Quote:
chmod +x ntfs_mount.command
IMPORTANT NOTES:It is important that you give full paths! (so not just "mkdir", but "/bin/mkdir") This is necessary for cron (explained later) to work. You should replace disk0s1 for your partitions identifier (use Disk Utility to determine it). Instead of data you can name the directory whatever you like. the volname=Data sets the name with which it appears on you desktop and in finder. Name it whatever you like. Depending on how you installed ntfs-3g, it may or may not reside in "/sw/bin/ntfs-3g", if not, then change it to the right path.


Now we need to make ntfs-3g executable for normal users (sudo won't be needed anymore. And there won't be a flag needed anymore for the privilege problem when copying to the disk)
Open the terminal, browse to the directory containing ntfs-3g (in my case its "/sw/bin/ntfs-3g") and type:
Quote:
sudo chmod u+s ntfs-3g
If everything worked right you could double click ntfs_mount.command from finder. It will unmount the disk if it is already mounted (no matter if it's ntfs-3g or normal ntfs mounted) and directly remount it using ntfs-3g with read/write support!
NOTE: you shouldn't go any further before you get this working!

Now we need to make this script automatically run at boot up. We use cron for this. The big plus of cron is, that it won't open you terminal and leave it open (which "Login Items" would do for example). Open a terminal and type:
Quote:
cd /etc
sudo nano crontab
and add this line:
Quote:
@reboot koen /mount_ntfs/mount_ntfs.command
replace "koen" with you user name.
Save the file (using Control + O). If you did everything right it should launch the shell script on boot up, so you ntfs partition will be automatically mounted. I would say: give it a try and remount!
Enjoy!

Greetings Koen

Last edited by koen : 2007-07-03 at 06:32.
  quote
backslash
New Member
 
Join Date: Feb 2007
 
2007-07-10, 04:53

bash doesnt work for me, i used shell:
Code:
#!/bin/sh /usr/sbin/diskutil unmount /dev/disk0s1 /bin/mkdir /volumes/data /sw/bin/ntfs-3g /dev/disk0s1 /volumes/data -o volname=Data
and instead of
Code:
chmod +x ntfs_mount.command
i used
Code:
sudo chmod u+s ntfs_mount.command
now everything is find
  quote
mrelwood
 
 
2007-08-20, 03:50

The shell script to mount the disc does not work for me. Entering the lines individually does work, but as a command, it doesn't. I tried both headers, #!/bin/sh and #!/bin/bash. What I get is an explanation for Disk Utility usage. I changed the permissions with both ways. Should I use a different header?

I have an Intel MacBook C2D, 2GHz 2GB, OS X 10.4.10.
  quote
David4Mac
 
 
2008-09-11, 14:38

I am sorry but I am a newbie to both Mac and Apple Script but I run both Mac OSX 10.5 and XP and would really like this external drive to work for me that is NTFS formatted.

I followed all your instructions - installing Macfuse and Fink - easy installs

Then I created the text file you suggested in Word and saved as a text file. This is where I got lost!

How do you find the folder in "Terminal"? Seems I need a command to locate the folder (applications/utilities/ntfs_mount
yet while it finds the folder - I don't seem to be able to figure out how to open it so the command executes the script!

From there it is all greek because I don't know how to "browse folders" when in terminal - so if someone could help me with a few more lines (e.g. to browse the folder use this script...) that would be really really appreciated!

Also, I have done all this on my computer - how do I undo it in case I can' t figure it out?

Thanks - David
  quote
alcimedes
I shot the sherrif.
 
Join Date: May 2004
Send a message via ICQ to alcimedes  
2008-09-11, 14:43

If you've done the install of MacFuse correctly, I thought you could read/write the drive in your GUI just fine, no command line necessary.
  quote
David4Mac
 
 
2008-09-11, 14:58

I probably just posted in this thread to then answer my own question with some software you have to pay for in order to do the same thing that MacFuse does for free. I was hoping no one would notice.

David4Mac

Last edited by alcimedes : 2008-09-11 at 15:25. Reason: spam
  quote
alcimedes
I shot the sherrif.
 
Join Date: May 2004
Send a message via ICQ to alcimedes  
2008-09-11, 15:24

So you resurrected a year old thread to say you were confused by MacFuse, and 20 minutes later you happened to find a pay-for "cure".

Sorry. I don't buy it.

Anyone reading this, give:

http://code.google.com/p/macfuse/

A shot. Save your $40.

Google is your frenemy.
Caveat Emptor - Latin for tough titty
I tend to interpret things in the way that's most hilarious to me
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Camp Help Pleaseeee moo Genius Bar 32 2007-10-01 18:44
Backup NTFS ? chained General Discussion 2 2007-06-14 14:31
Wow, I never knew MacOS X can read NTFS partition! BlueApple Apple Products 8 2006-06-22 00:01


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 04:33.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova