Disk mounting / unmounting tool

Discussion in 'OS X Mountain Lion (10.8)' started by smellalot, Jan 12, 2013.

  1. macrumors 6502

    Joined:
    Dec 6, 2011
    #1
    I'm looking for a little tool that sits in the menu bar to unmount / mount my internal HDD so my Mac can be nice and silent.

    I googled but the two tools I tried did not work. Does anybody know a good tool that unmounts the drive and actually makes it stop spinning and then gives you the option to mount that drive again?
     
  2. macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #2
    Are you talking about your primary HD with your boot partition? If so, you can't.

    Get yourself an SSD and not only will it be silent, you'll see massive performance gains.
     
  3. smellalot, Jan 12, 2013
    Last edited: Jan 12, 2013

    thread starter macrumors 6502

    Joined:
    Dec 6, 2011
    #3
    Look at my signature.

    Edit: Thank you still. , Didn't want to sound rude.
     
  4. macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #4
    Didn't notice that!

    What applications did you try? Was the problem when mounting, unmounting, or both? Did the application report any errors to you?

    Any application you are trying to use will probably be using either mount/umount or diskutil from the command line.

    Maybe manually run one of these commands and see if it still fails and if so, you might get some more info as to why.

    The most common reason for umount failing is that a file on the partition being unmounted is still in use.
     
  5. thread starter macrumors 6502

    Joined:
    Dec 6, 2011
    #5
    I tried Free Space Tab, which unmounts the drive fine and spins it down immediately. But it can't mount drives so I'd still need to go to disk utility for that.

    Semulov is another tool I tried. It unmounts the drive but the disk keeps spinning. On the other hand it shows unmounted drives.

    None of the tools gave me an error. But I was hoping someone knows an app that combines the good feature of these two ;)
     
  6. macrumors 603

    Joined:
    Feb 20, 2009
    #6
    Back in the days of the Classic Mac OS, there was a very nifty tool called "SCSI Probe" which would scan the SCSI bus and mount drives that it found.

    Too bad there is no modern-day equivalent with which to "probe" the USB and firewire buses to do the same thing...
     
  7. macrumors newbie

    Joined:
    Feb 12, 2012
    #7
    i use applescript with alfred :
    Code:
     set myVolumeLabel to "OptiBay"
    
    tell application "Finder"
    	set diskDev to do shell script "diskutil list | grep \"" & myVolumeLabel & "\" | grep -o 'disk[0-9]*' "
    	if not (disk myVolumeLabel exists) then
    		do shell script "diskutil mountDisk " & diskDev
    	else
    		do shell script "diskutil unmountDisk " & diskDev
    	end if
    end tell 
     
  8. thread starter macrumors 6502

    Joined:
    Dec 6, 2011
    #8
    OK, thank you for your help. Unfortunately my disk keeps spinning. I tried to modify your script by using the record feature of apple script editor. I recorded the CMD+E command in Finder and replaced the unmount routine in your script. Unfortunately it doesn't work. Do you have an idea why? Here's my script:

    Code:
    set myVolumeLabel to "HDD"
    
    tell application "Finder"
    	set diskDev to do shell script "diskutil list | grep \"" & myVolumeLabel & "\" | grep -o 'disk[0-9]*' "
    	if not (disk myVolumeLabel exists) then
    		do shell script "diskutil mountDisk " & diskDev
    	else
    		tell application "Finder"
    			activate
    			eject disk myVolumeLabel
    		end tell
    	end if
    end tell

    Any help will be greatly appreciated since I really like my Mac quiet!
     
  9. thread starter macrumors 6502

    Joined:
    Dec 6, 2011
    #9
    I found it! For anyone else having this problem:

    Use the command eject instead of unmountDisk. See the correct code below.

    Code:
    set myVolumeLabel to "HDD"
    
    tell application "Finder"
    	set diskDev to do shell script "diskutil list | grep \"" & myVolumeLabel & "\" | grep -o 'disk[0-9]*' "
    	if not (disk myVolumeLabel exists) then
    		do shell script "diskutil mountDisk " & diskDev
    	else
    		do shell script "diskutil eject " & diskDev
    	end if
    end tell
     
  10. macrumors newbie

    Joined:
    Feb 12, 2012
    #10
    For me on MBP 13" 2011 work ok with "diskutil unmountDisk" but You found solution for your problem - It is important. Sorry for my bad English :)
     
  11. macrumors regular

    Joined:
    Oct 23, 2009
    #11
  12. macrumors newbie

    Joined:
    Feb 2, 2013
    #12

Share This Page