Jump to content

[How To] Make Mac OS X automount NTFS Drives in read/write mode


49 posts in this topic

Recommended Posts

This guide is rather fool-proof, but it involves messing with /sbin system directory, so remember, you're doing it at your own risk.

 

Big thanx to danielj7 and asstolavista from ntfs-3g forum for inspiration. Without them, this won't be possible.

Also I`d like to thank antoinef and Cliffton Beach for some really usefull comments in this thread that led to revision 2 of the Guide, and Greg134 for showing a simple solution to script problems with removable drives and spaces in partition name.

 

The Guide. Revision 2.1

1. Download and install MacFuse package, then reboot.

2. Download and install NTFS-3g package.

3. Download this file to your Desktop, then double click it, to extract the archive. The same file is attached at the end of this post, just in case.

4. Run Terminal from /Applications/Utilities Folder

5. Type cd ~/Desktop

6. Type sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.old

7. Type in your password when requested and press Enter

8. Type sudo cp mount_ntfs /sbin/

9. Type sudo chown root:wheel /sbin/mount_ntfs

10. Type sudo chmod 555 /sbin/mount_ntfs

11. Reboot

 

 

After reboot, your NTFS drives should be mounted with read/write permissions automatically.

If you remount unmouned drives through Disc Utility, or plug in additional NTFS drives, they will be mounted with read/write permissions also.

 

Additional info for multilingual users

If you have files with names in languages, other then english, on your NTFS drives, they won't be shown by default.

To see such files, you must slightly edit the file extracted from the downloaded archive. You can edit it with TextEdit while its still on your desktop, or after completing the guide by typing "sudo nano /sbin/mount_ntfs".

 

Here's what should be inside the file by default:

#!/bin/sh

 

args=$#

MOUNTPOINT=${!args}

VOLNAME=${MOUNTPOINT##*/}

args=$((args-1))

DEVICE=${!args}

/usr/local/bin/ntfs-3g $DEVICE "$MOUNTPOINT" -o default_permissions -o locale=
ru_RU
-o volname="$VOLNAME"

With RED color, I highlited the locale section, where you can change your locale. I, myself, have files with names in Russian, so I use ru_RU locale to see these files.

 

To see a list of locales, installed in your system, open Terminal and type locale -a.

 

There is a chance, that after the folders with names in other languages appear, you won't be able to open files from them. In that case, just rename the folder once, and rename it back. Mac OS X will write the folder name in correct encoding and all files will open after this.

 

Restoring default NTFS mounter

In case anything went wrong, just run Terminal, type sudo mv /sbin/mount_ntfs.old /sbin/mount_ntfs and enter your password.

 

Please report success and failures in this thread if you try this method. Thank you.

mount_ntfs.zip

Link to comment
Share on other sites

hi there!

 

i tried this, but now i cant mount my ntfs partitions.

 

when i did this, all drives were mounted. should i have unmounted them first?

 

also, the restoring NTFS mounter at the end of your tutorial (just in case something goes wrong) doesnt mount my ntfs partitions either.

 

help

Link to comment
Share on other sites

To restore deafult mounter you need to do what I wrote in restore section of the guide, and then reboot.

It should help, if you followed the guide, because on step 12, you do a backup of your default ntfs mounter, and in restore section of the guide, you just copy the default, backed-up mounter over new one.

 

If it doen't help, please run Terminal and type the following:

 

nano /sbin/mount_ntfs

 

If it shows you some unreadable stuff, that means, that your default ntfs mounter is back in place and mounting drives through Disk Utility should work. If it shows you the contents of the script you copied, it means restore didn't work for some reason.

 

Please report if youre succesfull with restoration or making ntfs automount work.

Link to comment
Share on other sites

Hi, pals!

 

I got problema of the next kind: I successfully install the latest mucfuse & ntfs-3g from their google's site, all ntfs drives mount correctly, read-and-write - all 100%.

 

But when I insert Video-DVD or try to mount some DMG-images (I guess - compressed) - they are not SEEN in system, and DMG mountainer talks about the standart error: "No mounting filesystems".

 

I 100% sure that it's about ntfs-3g' consequence, but how can I repair this one? Or maybe I should write down only NTFS drives to be mounted into ntfs-3f.mount or what??

 

Help in solving, please!

Link to comment
Share on other sites

Did not work for me, volumes did not automount upon plugging them in like before. Do i have to mount it manually? Restored to default mounter and it recognizes / mounts the volume, but I still cannot read write.

 

Any suggestions?

 

via jas 10.4.8.

Link to comment
Share on other sites

Sorry to hear people have problems. This worked for me.

 

Please be more precise about problems.

 

If something didn't work for you, please run Disk Utility and try mounting drives manually.

 

Mr-Mur, did the guide work for you, or you made it some other way?

Link to comment
Share on other sites

Hello,

 

Just for your information, when I plugged an ntfs external hard drive, the system invokes the script with the option parameters first and add the device and mountpoint parameters at the end of parameter list.

So I needed to change the script a bit to put the eight parameter in the VOLNAME variable like that:

 

VOLNAME=${8%/}

 

Otherwise, that worked perfectly for me.

Antoine

Link to comment
Share on other sites

antoinef

Thanx for the first success story. I started thinking it doesn't work for anyone except me. :unsure:

 

onizuka

diskutil uses mount_ntfs app to mount drives. In this guide, its replaced by a shell script. Diskutil starts mount_ntfs with parameters, and the second parameter is the name of NTFS partition. So in a script, VOLNAME is a variable that is given a value of partition name.

 

Sorry if my english is bad ) I don't know if I explained it so that you can understand.

 

P.S. I just found a program called iMountit which seems to cope with the same task much easier. Those who failed with my guide, could try it.

Link to comment
Share on other sites

Guess so :)I'm not too good at this, I just posted a script which works for me. But I don't see a reason why changing a variable name should change anything globaly.

 

antoinef

I tried VOLNAME=${8%/} and it labels my drive as disk1s1 or smth, not with volume names.

 

onizuka

iMountIt is great, the problem is, it doesn't automount all ntfs drives on boot up.

Link to comment
Share on other sites

work fine here

 

to test (replace X & Y)

# sudo diskutil mount /dev/diskXsY

# sudo diskutil umount /dev/diskXsY

 

i have got some problem with uphuck dvd (dmg not working)

if some one have this release, before install newer version remove the older one

 

# cd /System/Library/Filesystem

# sudo rm -rf ntfs-3g* fuse*

# cd /sbin/

# rm -rf *ntfs-3g*

Link to comment
Share on other sites

Guess so :)I'm not too good at this, I just posted a script which works for me. But I don't see a reason why changing a variable name should change anything globaly.

 

antoinef

I tried VOLNAME=${8%/} and it labels my drive as disk1s1 or smth, not with volume names.

 

onizuka

iMountIt is great, the problem is, it doesn't automount all ntfs drives on boot up.

 

@onizuka

 

I am the blogger of daysofourmacbooks.blogspot.com and I am glad to hear that iMounitIt is used by some people at least;)

anyways at first I really wanted the app not to automount ntfs drives because I didn't want the drive/volume to be via ntfs 3g unless I needed the write access.

However, iMountIt is now in an update process and an automount feature might be integrated if a lot of users wish so.

 

MB-switcher

Link to comment
Share on other sites

Indeed, automount would be great, but I like iMountIt the way it is now.

By the way, are external drives supposed to mount too? I tried with the NTFS partition of my external USB drive and there was some kind of error...

But thanks for that great software!

Link to comment
Share on other sites

Hi,

external drives and volumes should be supported actually since it is only a front end app for ntfs 3g. The idea of having iMountIt actually came from the need I had to write on NTFS formatted external drives because I switched a few months ago and didn't want to reformat all the external drives I had. An updated version will be released soon though because susumu of McDoDesign supplied me with an awesome application icon that I hope everyone else will like too;)

 

MB-switcher

Link to comment
Share on other sites

Hello,

 

I noticed that the arguments passed to the script are different if I mount my Windows partition from my main hard drive or if I mount an external hard drive. So I cannot initialize VOLNAME based on the position of the argument in the command line. But there is one thing for sure, at some point in the command line, the device will be followed by a mountpoint.

So to initialize VOLNAME, I look for the second argument, which begins with a '/' and I get the string following the last '/' of this argument.

I use regular expressions and perl to do that:

 

VOLNAME=`echo $@ | perl -ne '@args=split();

foreach $arg(@args){

$res=$arg

if($arg=~/^\//);

};

$res=~s/^.+?([^\/]+)$/$1/;

print "$res";'`

 

Antoine

Link to comment
Share on other sites

(((HELP)))

 

I am new to all of this so please be gentle.

 

Here is what I hope to achieve, be able to read/write to my NTFS USB 8Gb jump drive.

 

I have followed the guide to the letter, works great for my internal NTFS drive (did the VOLNAME=${8%/} that Antoine suggested) but the usb drive, disk identifier: disk1s1, gives me the "The Operation cannot be completed becuse you do not have sufficient privileges for some of the items" message when I try to put something there. It does not seem to care what the file is, it still is not happy.

 

I have tried the iMountIt program and I still get the same error message when transfer a file to the USB drive.

 

Have I missed a step or do I need to modify something?

 

Remember, I have no clue what I am doing, so please talk to me like I am an idot, becuase when it comes to this unix programming stuff (I hope that is the language).....I am.

 

Thanks a ton.

Link to comment
Share on other sites

@all: to restore your previous ntfs, simply type

 

sudo rm /sbin/mount_ntfs

sudo mv /sbin/mount_ntfs.old /sbin/mount_ntfs

 

@Laik:

 

Thanks for your workaround :)

 

Imo there is something wrong with the NTFS-3g. However, NTFS-3g seems to work only for very few people, depending on destiny, weather and karma. :D And even if one get it to work, there is a very good chance to damage the file system. I would name this NTFS-3g... simply {censored}. (Ok I can't do it better, but well... I also wouldn't release stuff like that) :D

Link to comment
Share on other sites

antoinef

Great, I'll try your method, it seems to be much more universal. Thanx! If it works for me, I'll update the guide.

 

daedalus01

I had the same issue, before. I fixed it, by installing the latest NTFS-3g and using "-o default_permissions" in ntfs-3g mount string, which you can see in the guide.

 

Try reinstalling macfuse, and getting latest ntfs-3g from here. Hope it helps.

Link to comment
Share on other sites

laik:

Works like a charm. Automount on boot and all.

 

antoinef:

Perl makes my head hurt :) Perhaps an easier way to get the volume label is

VOLNAME=`/usr/local/sbin/ntfslabel -n $1`

 

xtraa:

I haven't had problems with ntfs3g. I've been using it for a half year at least on Linux and it's been flawless. A lot of the problems are probably people not following the guide quite right. Other problems may be due to not getting the script nailed down for all possible cases. Both of those are outside of ntfs-3g's area of responsibility. Once it is called with the correct parameters, it does a fine job of mounting the file system and allowing writes, and has been tested on thousands of machines.

 

Again, if there are any problems, it is due to the way OSX mounts things. Since disks are detected and mounted asynchronously, they are sometimes assigned a different /dev/diskN node based on how fast devices respond to bus probing. This means we can't rely on a static /etc/fstab file like other *nixes, but need scripts that take parameters (from diskutil or wherever) and give consistent results. Most problems are probably due to we OSX users not getting those scripts just right yet and are not to be laid at the feet of ntfs-3g.

Link to comment
Share on other sites

antoinef

Your part or the script worked like a charm, thanx!

Though the variant Cliffton Beach suggests is less geek and also seems to work good ;)

 

Cliffton Beach

Thank you too! I'll update the guide using your way of getting volume label, and make it a bit more foolproof.

Link to comment
Share on other sites

VOLNAME=`/usr/local/sbin/ntfslabel -n $1` works well enough for me, but I haven't tested it in the situation antoinef ran into that caused him to write his script. He wrote his script since the volume name isn't always passed as argument 2.

 

VOLNAME=`/usr/local/sbin/ntfslabel -n $1` will get the correct volume name assuming the device node is passed as argument 1. I don't know if that is the case. If not, something more like his geeky was could be necessary.

 

Hopefully we can hear back from him on that point. One way or another, the script will get finished up!

Link to comment
Share on other sites

Cliffton Beach

I tried to initialize VOLNAME the way you do it. As you said the script works as long as the device node is passed as argument 1. That is not the case all the time for me. When I mount my Windows partition, it works but has a side effect: this partition doesn't have a label. As a result 'ntfslabel' returns an empty string, ntfs-3g still works when you pass the option '-o volname='. The option is ignored and the partition is labeled using the device node (eg: disk*s*). I prefer to see my partition labeled 'Untitled' rather than the device node.

 

When I want to mount my enclosure, the first argument is not a device but '-o', so 'ntfslabel' fails and returns -1 and makes the script abort before the 'ntfs-3g' command is invoked. So my drive is not mounted at all.

 

So I will stick to my way. There is one thing which can be bad about my way. I can't remember if perl is provided natively with Mac OS X or if it is provided with XCode. If the user has to install XCode (couple of GB) just to make the script work, it is really bad. I didn't check but perl could also be installed via fink.

 

Hope this helps!

Link to comment
Share on other sites

 Share

×
×
  • Create New...