Subscribe to our RSS news feed
AAPL 199.94 (-1.25)

> Forum Guidelines.

Welcome to the Genius Bar. Here's how this forum works:

1. Members are encouraged to make a guide that details something that they might have found troubling or challenging.
Chances are, if you've seen the same question asked over and over again, you should write a guide for it.

2. This is not the forum for asking questions. If you have a question about a thread that's already here, feel free to ask it.
Just don't start a thread for a specific question. Use the other forums here for that.

3. Posting links to off-site tutorials is not allowed.

4. That's it! Thanks for sharing your information with the rest of us. :)

To keep this forum clean this forum is moderated. You can post in existing topics but new ones will have to be approved before they show up.

 
Reply to this topic Start new topic
[How to] Automount NTFS-partition using (newest) ntfs-3g., no outdated links to shadowofged.
*
  • Group: Members
  • Posts: 19
  • Joined: 6-May 07
  • From: Delft, Netherlands
  • Member No.: 105,993
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:

CODE
#!/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
CODE
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:
CODE
sudo chmod u+s ntfs-3g


If everything worked right you should 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! If it doesn't work you might consider to replace
CODE
#!/bin/bash

with
CODE
#!/bin/sh



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:
CODE
cd /etc
sudo nano crontab


and add this line:
CODE
@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

P.s. please let me know if you have any suggestions or comments. And please let me also know if it works for you...
PM Profile Card
Go to the top of the page
+ Quote Post
**
  • Group: Members
  • Posts: 98
  • Joined: 16-August 05
  • From: New York
  • Member No.: 6,544
This is great buddy, I'm gonna try it out soon...
you learn something new everyday wink.gif
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 8
  • Joined: 30-April 07
  • Member No.: 104,624
It works! biggrin.gif Thank you
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 16
  • Joined: 27-August 06
  • Member No.: 53,142
i did everything you said and the command file works but it does nothing at start up...
Edit: I used this program and it worked
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 19
  • Joined: 6-May 07
  • From: Delft, Netherlands
  • Member No.: 105,993
QUOTE (wonkajh @ Jul 17 2007, 08:12 PM) *
i did everything you said and the command file works but it does nothing at start up...
Edit: I used this program and it worked


Wonkajh, this is a good alternative to use instead of cron (which normally takes care of executing the shellscript at boot up). In fact, you might even call it a better thing than using cron. Because since tiger "cron" is mostly replaced (and thus cron is becoming "outdated") by launchd. Cron is for me easier to use though...

Greetings.

P.s. NTFS-3g 1.710 is out! An OS X version is available using Fink! I'll try it one of these days.
PM Profile Card
Go to the top of the page
+ Quote Post
***********
  • Group: Members
  • Posts: 2,729
  • Joined: 3-September 05
  • From: Paris, France
  • Member No.: 9,104
once uve complied 1.7 plz post it smile.gif
PM Profile Card
Go to the top of the page
+ Quote Post
*
  • Group: Members
  • Posts: 19
  • Joined: 6-May 07
  • From: Delft, Netherlands
  • Member No.: 105,993
QUOTE (cyclonefr @ Jul 21 2007, 01:47 PM) *
once uve complied 1.7 plz post it smile.gif


Sorry but i don't know how to make a .pkg which contains it. Also i don't know if it needs to contain more than the ntfs-3g binary (which it probably will). I just don't have the knowledge for making such a packet. Though i do know that compiling on your own is best for performance, and much much easier than some people think. So i would say: Give it a shot! Just follow the tutorials i linked to at the top of this page. installing xcode takes the most time i think (because its huge: 900 mb...)

2 notes about the compiling tut:
- when you do not see an option to enable unstable packages when running "/sw/bin/fink configure" then just go further. run all the commands until "/sw/bin/fink install ntfs-3g". after that one, please start again from "/sw/bin/fink configure". This time you should see the enable unstable packages option. after this you need to redo the following steps (of which you have done already a few).
- when you run into problems saying things about permissions you should try adding "sudo" before the command. So for example "/sw/bin/ntfs-3g /dev/disk2s1 /Volumes/ntfsdrive" becomes:
"sudo /sw/bin/ntfs-3g /dev/disk2s1 /Volumes/ntfsdrive"

Good luck! Let me know if you succeed or have problems.

Greetings Koen
PM Profile Card
Go to the top of the page
+ Quote Post
*******
  • Group: Members
  • Posts: 703
  • Joined: 14-February 06
  • Member No.: 23,385
i automount my drives by writing a applescript and save is as a application bundle and load it during login, but one thing i can't figure out is, my drive's mount point seem varies, exp. disk0s1 and disk1s1, they will swap ?! anyone knows how to fix this? thanks
PM Profile Card
Go to the top of the page
+ Quote Post
***********
  • Group: Members
  • Posts: 2,729
  • Joined: 3-September 05
  • From: Paris, France
  • Member No.: 9,104
dmg file such as earlier version would be appreciated guys
PM Profile Card
Go to the top of the page
+ Quote Post
Reply to this topic Start new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 21st November 2009 - 12:03 PM