Help - Search - Members - Calendar
Full Version: Can I turn off automounting for my NTFS volume?
InsanelyMac Forum > Apple World > Mac Programming and Development > AppleScript and Automator
xtraa
Hi smile.gif

When I start my OSX, It allways automounts all volumes including my Windows NTFS volume on the desktop.
But I don't want to mount it in OSX anymore, because I can't use it anyway.

Also what me scares is that clicking noise when OSX puts the drive into sleep mode or wake it up.

Spooky blink.gif laugh.gif

Drivetest and other tools says the volume is ok, but i saw lots of drives doing this kind of noise before crossing
the jordan.

So i did a search but i did not found anything really related. normally Apple comes without ntfs volumes on
it biggrin.gif and that makes it hard to find at google. So maybe you can help me out?

I would appreciate any hint on this.
antrunix
See picture
fireshark
It doesnt do it for mine - JaS PPF patch, on 2nd partition, but it sees it (in Disk Utility)
xtraa
thanks antrunix,

good idea smile.gif but unfortunately that does not show any effect here,
it is already unchecked. also checking it > reboot > unchecking it
does not work.
mk14
QUOTE(xtraa @ Dec 4 2005, 08:38 AM) *
When I start my OSX, It allways automounts all volumes including my Windows NTFS volume on the desktop.
But I don't want to mount it in OSX anymore, because I can't use it anyway.

You can probably write an AppleScript that automatically unmounts the NTFS volume when you login.
CODE
tell application "Terminal"
activate
do script "diskutil unmount disk0s8
quit
end tell

Save that as an Application and drag it into the Login Items in the Accounts PrefPane.


QUOTE(xtraa @ Dec 4 2005, 08:38 AM) *
Also what me scares is that clicking noise when OSX puts the drive into sleep mode or wake it up.

You can turn off putting hard drives to sleep. In the Energy Saver PrefPane, or using the CHUD Tools.

Michael
A Nonny Moose
For some odd reason I tried making a script using Finder instead of Terminal (because you're opening and closing an application) and it won't let me eject a specifically named disk. grrr

Although you might want to put in a "delay 8" in that script before quitting Terminal or else it might try and quit in the middle of a process (and thus ruin any chance of a seemless operation because you're being asked to quit). The completed script would look like this:

tell application "Terminal"
activate
do script "diskutil unmount disk0s8"
delay 8
quit
end tell

tried it. Works beautifully. You can set the delay trigger to however long you want it to be in seconds.
A Nonny Moose
Yeah, it's posted in about 8 other forums here also.
Timyang
The shortcut method doesn't really work for me since I found the NTFS partition has significant negative impact on spotlight performances since OS X can't write the index files to it, unmounting it prevent spotlight from searching it all together.
You can also use "do shell script" in applescript so you don't need to call Terminal, just
CODE
do shell script "diskutil unmount disk0s8"

replace disk0s8 with whatever identifier the disk you want to unmount has. I run this on startup to unmount my windows partition on my iMac, but somehow it is always really slow (taking up to 10 seconds or more to unmount it after the script is run), any one know any cause?
domino
QUOTE
I run this on startup to unmount my windows partition on my iMac, but somehow it is always really slow (taking up to 10 seconds or more to unmount it after the script is run), any one know any cause?

Did you save the script as a bundled application? Have you tried to run the script in system run services and not per user?
jgrimes80
Here's what I use...

CODE
tell application "Finder"
    if (exists disk "WINDOWS") then
        tell application "Terminal"
            activate
            do script "diskutil unmount disk0s3"
            delay 2
            quit
        end tell
    end if
end tell


If someone could tell me how to make this run in the background, that'd be spectacular!
A Nonny Moose
tell application "Finder"
if (exists disk "WINDOWS") then
do shell script "diskutil unmount disk0s8"
end if
end tell
jgrimes80
This is closer to what I'm after; but I don't even want to see the shell flash...

CODE
tell application "Finder"
    if (exists disk "WINDOWS") then
        tell application "Terminal"
            do script "diskutil unmount disk0s3"
            set visible of every window to false
            delay 2
            quit
        end tell
    end if
end tell
Timyang
QUOTE(domino @ Jun 5 2006, 10:27 PM) *
Did you save the script as a bundled application? Have you tried to run the script in system run services and not per user?

Yes i saved it as an app, but it's per user, that's probably the cause, thanks for the tip.

@jgrimes80: don't call terminal, use "do shell script" instead, you wont see shell pop up then. (what Nonny Moose wrote there)
Timyang
@domino: I tried save it as a bundled app, or as an app, but the speed hasnt improved, now where do I go set system run services? I've searched system preference for it and haven't see anything like it.
A Nonny Moose
I'd bet it takes long because of the Finder window. It's happened to me before where something got unmounted but it took the Finder a while to realize it really was unmounted.
quixos
here is a solution for people who will visit this thread for the first time. thanks to DucPilot1.

> [How To] Auto-Mount only selected partitions.

thanks to DucPilot1. biggrin.gif
SleeplessMedia
Easiest Method I have found.... In terminal type:

sudo pico /etc/rc
scroll down to the bottom of the file

insert the following at the end of the file

diskutil unmount /Volumes/"Name Of Volume"

hit ctrl -o to save
hit ctrl x to exit

reboot

done.
Rammjet
Usually when you update the system, the rc file gets replaced and you have to remember to do it again.

However, if you create an /etc/rc.local file and put the command in that, the file won't get replaced during an update, except in a clean install. The rc file looks for an rc.local file before it quits.
SleeplessMedia
Yeah, I found that out the hard way with my stupid PS2 keyboard workaround you tried to help me with... I dint know there was a local version of the file, Thanks again Rammjet, you are truly a blessing...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.