Skip navigation

how to NOT mount a harddrive on startup?

838 Views 30 Replies Latest reply: Feb 9, 2013 8:49 AM by mr. atif moeed RSS
  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 4:29 AM (in response to softwater)

    CORRECT:

    I tried your last script, works perfectly on an USB connected disk/partition (outside); did not do anything on the Disk/partition connected to the DVD sata connector (inside). It did not do anything, it did thus not display the error message !

  • softwater Level 5 Level 5 (5,370 points)
    Currently Being Moderated
    Feb 9, 2013 4:34 AM (in response to mdesignffm)

    mdesignffm wrote:

     

     

    actually, in my macbook, there is not one harddisk, there are two partitions of the same disk. but this should not affect the process - it should work with one partition just as well.

     

     

    Actually, I believe you should use the volume name, rather than the physical disk name. But if you did the

     

    "tell application "Finder" to get name of every disk" thing, then any name returned there should work.

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 4:34 AM (in response to softwater)

    I entered a message, but it seems not to have been posted.

    The message to softwater was:

    indeed: I tried your last script:

    works perfectly well on the USB connected disk/partition (external);

    it did not do anything to a disk/partition connected to the DVD sata connector (inside): not even the error message.

    Obviously the script does not reach the internal dvd sata connector. ???

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 4:37 AM (in response to LexSchellings)

    the name returned by the "get name of every disk" script was the name I used to do the above test.

  • softwater Level 5 Level 5 (5,370 points)
    Currently Being Moderated
    Feb 9, 2013 5:07 AM (in response to mdesignffm)

    Thanks Lex and mdesignffm. Yup, it does seem to be the fact that we're dealing with the DVD bus that is the issue.

     

    OK then, let's try a different approach. This time we're telling Applescript to invoke the Bash shell to do the dirty work:

     

    set theDisk to "Media 300GB"

    do shell script "diskutil umount " & quoted form of ("/Volumes/" & theDisk)

     

    There's no error dialog in this one, but if you look in the bottom panel of the Applescript editor under 'Results' you should see whether the disk was unmounted or not.

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 5:04 AM (in response to mdesignffm)

    Indeed, I copied your last test on HD Sata (the ssd), did not umount, did nothing. Thus not only the dvd sata but both internal sata ports.

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 5:08 AM (in response to softwater)

    YES: that works !!!

    unmounting with diskutil instead of finder.

  • softwater Level 5 Level 5 (5,370 points)
    Currently Being Moderated
    Feb 9, 2013 5:16 AM (in response to mdesignffm)

    Thanks guys. I learned something here, too (as well as being reminded why I love bash more than Applescript!!).

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 5:24 AM (in response to softwater)

    This was an interesting learning session for me. I am not after the unmounting thing of mdesign, but I loved this thread! Thanks softwater! Where is   ประเทศไทย   ???

    Lex

  • softwater Level 5 Level 5 (5,370 points)
    Currently Being Moderated
    Feb 9, 2013 7:10 AM (in response to LexSchellings)

    I'll leave you to solve the mystery of ประเทศไทย on your own (Google, as ever, is your... )...

     

    However, for the sake of completeness (and learning), and since we're in one of those all-too rare but nevertheless heart-warming 'caring and sharing' moments on ASC, I'd like to point out that there's a third way of tackling this problem. So far we have:

     

    1. Don't mount the disk at all (see Leroy's link to Topher's article, marked as the Answer to the thread).

     

    2. Unmount the disk automatically (as we've discovered together; don't forget to save the script as an .app and add to your login items)

     

    3. Leave the disk mounted but have it power down if not in use.

     

    The third option may be more suitable for some, particularly laptop users. After all, once the disk is powered down, it's not affecting system resources even though mounted.

     

    By default, on battery power OS X powers down any disk after 10 minutes of inactivity. You can reduce this default time by manipulating the pmset power management settings in Terminal.

     

    In Terminal.app, copy/paste this command:

     

    sudo pmset -b disksleep 5

     

    After pressing 'return' on your keyboard, you will need to enter an Admin password, which will be invisible when you type it (so type carefully!).

     

    This tells OS X to power down any disk that has not been accessed for 5 minutes (if you want to change it back to the default setting use the same command and replace '5' with '10').

     

    Note that this setting also applies to your startup disk, but since your startup disk is in more or less constant use, it's unlikely to be affected. However, the good thing about this command is OS X will immediately and automatically power the disk back up as soon as you do anything that calls a file on the disk (i.e., you don't have to do anything to get it to power up, OS X will handle it without your intervention).

     

    Personally, I have this set to 5 minutes for my startup disk (I don't have a secondary internal) simply because my battery is 69% health and well past the stage it needs servicing. Having the disk power down after 5 instead of 10 minutes eeks out a bit of extra battery time when I'm not connected to the mains.

     

    You can of course set the disksleep time to less than 5 minutes, but you probably don't want to for two reasons. One, because it affects all connected disks. And two because powering the disk up repeatedly after every, say, 2 minutes (say you're reading something on the net) will likely use more power over all than leaving the disk on. 5 minutes is a useful compromise, but it depends on the user. For your secondary disk, if you're not using it at all, it'll stay powered off after 5 minutes (but still mounted and available) until or unless you access it or call a file that resides on it.

    OS X Mountain Lion (10.8.2)
  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 7:51 AM (in response to softwater)

    So moved to Thailand, I remember something like Wales or so before ???

    1. I do not want to unmount the HD that is in the DVD location: It is partitioned in 2 partitions: one for the daily clone, and one for some backups and the large Photo and Music libraries accessed by iTunes and the Photo apps that reside on the startup SSD.

    2. I do not need to unmount the HD because it is accessed very regularly, and I not sure about the startup-gravel down procedure being non destructive.

    3. Aha, I am aware of this but I did not find conclusive evidence that is is good or bad for the SSD. The battery is my least important issue in the MBP. When this "put the disks to sleep when possible" command (either in preferences or in Terminal) should be separate for each Sata port, so no, I have them powered continuesly.

    4. I will use your script for the 2 external portable disks, that have together 3 partitions: one for (you guessed it already) a clone, and two for backups of my libraries.

    Thanks for the lessons taught here, was fun....

    Lex (Davos 1641m)

  • LexSchellings Level 5 Level 5 (5,495 points)
    Currently Being Moderated
    Feb 9, 2013 7:54 AM (in response to LexSchellings)

    and don't mark remarks about the english, i typed the post in 3 secs.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.