Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Hardware > Notebooks > MacBook Pro

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 16, 2011, 04:40 PM   #1
jrabbit
macrumors member
 
Join Date: Jan 2008
Location: St. Louis, MO
My solution to spin down the HDD in the OptiBay

There are numerous threads about removing the SuperDrive from the OptiBay, moving the HDD into the OptiBay, and installing an SSD in the main HDD space. I did these things using the DataDoubler from OWC; I'm very happy with the bracket quality and the overall results.

Like many, I was annoyed with the fact that there seemed to be no way under Lion to make the HDD in the OptiBay spin down. Fiddling with the Spotlight settings, using pmset to adjust parameters, and so forth did not resolve the issue.

To make peace, I did the following:
  1. Create "MountHDD" and "UnmountHDD" AppleScript "applications" that I can call easily using Alfred
  2. Set up SleepWatcher to run a script upon wakeup that will spin down the HDD volumes

Here is the contents of the "MountHDD" script:
Code:
do shell script "diskutil mount `diskutil list | grep 'Macintosh Data' | grep -o '\\(disk[0-9s]*\\)'`"
do shell script "diskutil mount `diskutil list | grep 'BOOTCAMP' | grep -o '\\(disk[0-9s]*\\)'`"
Here is the contents of the "UnmountHDD" script:
Code:
do shell script "diskutil eject 'Macintosh Data'"
do shell script "diskutil eject BOOTCAMP"
Here are the details for setting up SleepWatcher:

Tools
SleepWatcher 2.2 (from http://www.bernhard-baehr.de/)

Setup
Install the SleepWatcher software:
1. Execute the following commands in Terminal:
Code:
$ sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
$ sudo cp ~/Downloads/sleepwatcher_2.2/sleepwatcher /usr/local/sbin
$ sudo cp ~/Downloads/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8
2. Read the man page and think about the features of SleepWatcher you want to use:
Code:
$ man sleepwatcher
3. Create a shell script to unmount the partitions on wake using Terminal:
Code:
pico ~/.wakeup
3. a. Enter the following as the contents:
Code:
#!/bin/sh
diskutil eject 'Macintosh Data'
diskutil eject 'BOOTCAMP'
3. b. Set the wakeup script to be executable:
Code:
chmod a+x ~/.wakeup
4. Copy the sample 'de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist' file into the ~/Library/LaunchAgents directory
5. Load the launchd agent configuration using launchctl in Terminal:
Code:
cd ~/Library/LaunchAgents
launchctl load de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
6. Verify that the agent is running in Terminal:
Code:
launchctl list | grep sleepwatcher
Now the HDD will spin up/down when my MBP wakes up, and if I need the HDD volumes, I just have Alfred run the MoundHDD application. The MBP is fast and quiet, and I'm happy.

One additional note: the drives in the OptiBay are spun up and mounted upon system startup. I did not do anything to automatically unmount them, so if I'm not going to use them, I just call upon Alfred to run the UnmountHDD script.

Hope this helps someone else...
__________________
MBP 15 (late 2011) 2.4GHz, 6770M, 16GB Crucial RAM, 240GB OWC Mercury EXTREME Pro 6G SSD (HDD bay), 480GB Mushkin Callisto 3G SSD (optical bay); iPhone 4 32GB

Last edited by jrabbit; Mar 8, 2012 at 09:29 AM.
jrabbit is offline   2 Reply With Quote
Old Dec 16, 2011, 04:51 PM   #2
visim91
macrumors 6502
 
Join Date: Nov 2011
This is really cool.
Now, about the opposite - a SSD in the optibay & HDD in the primary disc space - would I have to worry about such things?

- The HDD is a storage bin for movies & media, SSD holds OSx etc.


-Also, I do not have SATA III in my Mac, thus I opted to keep the spinning drive in the primary enclosure, and the solid-state in the optibay.
visim91 is offline   0 Reply With Quote
Old Dec 17, 2011, 12:22 AM   #3
miker2209
macrumors regular
 
Join Date: Jan 2010
Just try not to let any program wake the HDD, like if u have iStat pro make sure it's not checking the memory or the temps on the HDD and Spotlight go to privacy and add the HDD in the Not to Search list.
Or easier just dismount the damn thing when your not using in, but IMO disabling Spotlight search or HDD and iStat pro will do the trick.
__________________
13" MacbookPro (Early 2011), 2.3GHz i5, 8GB RAM, 128GB Crucial M4 SSD + 320GB Optibay HDD
miker2209 is offline   0 Reply With Quote
Old Dec 17, 2011, 03:28 AM   #4
wikus
Banned
 
Join Date: Jun 2011
Location: Planet earth.
Quote:
Originally Posted by visim91 View Post
This is really cool.
Now, about the opposite - a SSD in the optibay & HDD in the primary disc space - would I have to worry about such things?

- The HDD is a storage bin for movies & media, SSD holds OSx etc.


-Also, I do not have SATA III in my Mac, thus I opted to keep the spinning drive in the primary enclosure, and the solid-state in the optibay.
Its recommended that you have your SSD drive in the optibay. The main bay has some kind of anti-shock mechanism specifically for HDDs. You'll want to leave your stock HDD or replacement HDD in its default location, which is what I did (120gb Intel 320 SSD in optibay and Western Digital 1TB in the primary bay).
wikus is offline   0 Reply With Quote
Old Dec 17, 2011, 09:08 AM   #5
visim91
macrumors 6502
 
Join Date: Nov 2011
Quote:
Originally Posted by wikus View Post
Its recommended that you have your SSD drive in the optibay. The main bay has some kind of anti-shock mechanism specifically for HDDs. You'll want to leave your stock HDD or replacement HDD in its default location, which is what I did (120gb Intel 320 SSD in optibay and Western Digital 1TB in the primary bay).
We can do such things because our Mac's maximum speed remains 3.0 GB/s - also known as "SATA II".
Those with newer models can attain speeds up to 6.0 GB/s - also known as "SATA III"; but, only if they elect to keep their SSD in the main bay, where the SATA III configuration is present.
The optibay, in their situation, is only SATA II; thus, it would be counterproductive to place the SSD there.

This is as far as I know, if I am wrong please correct me.
visim91 is offline   0 Reply With Quote
Old Dec 17, 2011, 09:49 AM   #6
Ant.honey
macrumors regular
 
Join Date: Oct 2008
Location: New York City
I'm sure it's rewarding and such to write and run the scripts, but just dismounting seems like a lot less trouble to me. Also, perhaps I'm not as sensitive, but the spinning hard drive I don't really hear or at least it doesn't ever bother me. If it's cutting battery life, it's very insignificant. YMMV.
Ant.honey is offline   0 Reply With Quote
Old Dec 17, 2011, 10:20 AM   #7
Satnam1989
Banned
 
Join Date: Nov 2011
Location: Illinois
 
see vendor information in user profile
Quote:
Originally Posted by jrabbit View Post
There are numerous threads about removing the SuperDrive from the OptiBay, moving the HDD into the OptiBay, and installing an SSD in the main HDD space. I did these things using the DataDouble from OWC; I'm very happy with the bracket quality and the overall results.

Like many, I was annoyed with the fact that there seemed to be no way under Lion to make the HDD in the OptiBay spin down. Fiddling with the Spotlight settings, using pmset to adjust parameters, and so forth did not resolve the issue.

To make peace, I did the following:
  1. Create "MountHDD" and "UnmountHDD" AppleScript "applications" that I can call easily using Alfred
  2. Set up SleepWatcher to run a script upon wakeup that will spin down the HDD volumes

Here is the contents of the "MountHDD" script:
Code:
do shell script "diskutil mount `diskutil list | grep 'Macintosh Data' | grep -o '\\(disk[0-9s]*\\)'`"
do shell script "diskutil mount `diskutil list | grep 'BOOTCAMP' | grep -o '\\(disk[0-9s]*\\)'`"
Here is the contents of the "UnmountHDD" script:
Code:
do shell script "diskutil eject 'Macintosh Data'"
do shell script "diskutil eject BOOTCAMP"
Here are the details for setting up SleepWatcher:

Tools
SleepWatcher 2.2 (from http://www.bernhard-baehr.de/)

Setup
Install the SleepWatcher software:
1. Execute the following commands in Terminal:
Code:
$ sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
$ sudo cp ~/Downloads/sleepwatcher_2.2/sleepwatcher /usr/local/sbin
$ sudo cp ~/Downloads/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8
2. Read the man page and think about the features of SleepWatcher you want to use:
Code:
$ man sleepwatcher
3. Create a shell script to unmount the partitions on wake using Terminal:
Code:
pico ~/.wakeup
3. a. Enter the following as the contents:
Code:
#!/bin/sh
diskutil eject 'Macintosh Data'
diskutil eject 'BOOTCAMP'
3. b. Set the wakeup script to be executable:
Code:
chmod a+x ~/.wakeup
4. Copy the sample 'de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist' file into the ~/Library/LaunchAgents directory
5. Load the launchd agent configuration using launchctl in Terminal:
Code:
cd ~/Library/LaunchAgents
launchctl load de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist
6. Verify that the agent is running in Terminal:
Code:
launchctl list | grep sleepwatcher
Now the HDD will spin up/down when my MBP wakes up, and if I need the HDD volumes, I just have Alfred run the MoundHDD application. The MBP is fast and quiet, and I'm happy.

Hope this helps someone else...
Excellent post, ill have to give it a try sometime when I'm up for it, been kinda looking for a solution maybe apple will be nice enough to add the spin down features into Lion once th enew MBP's hit the shelves and if they opt to remove the OD and add support for dual HDD's
Satnam1989 is offline   0 Reply With Quote
Old Dec 17, 2011, 10:44 AM   #8
happle
macrumors 6502
 
Join Date: Jun 2010
woulding spinning down the drive often make the load cycle count go out of control?
__________________
15" MBP Hi-Res AG, 2.4GHz i7 Quad, HD 6770M 1GB VRAM, 8GB Crucial 1333 RAM, 128GB Toshiba SSD, 640GB Hitachi 7k in Optibay
64gb iTouch
happle is offline   0 Reply With Quote
Old Dec 17, 2011, 11:13 AM   #9
Satnam1989
Banned
 
Join Date: Nov 2011
Location: Illinois
 
see vendor information in user profile
Quote:
Originally Posted by happle View Post
woulding spinning down the drive often make the load cycle count go out of control?
I can't answer ur question but I did try another guys HDAPM command/instal instructions from this forum, changed the disk for it to work on to disk1(which is my HDD) from disk0, but noticed that it didn't work after I restarted my MBP that day....since then my heads been parking as it did before......btw if you can't run the commands just unmount your partitions(all that you have for ur optical bay HDD) make sure iSTAT is not running at all, I have my HDD Space monitoring and temperature turned off in iSTAT but it still wakes up my HDD as soon as I launch my dashboard....so iSTAT is definitely a HDD waker!
Satnam1989 is offline   0 Reply With Quote
Old Mar 7, 2012, 02:34 PM   #10
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
Noob

Hi jrabbit

Could you explain it but as if you were explaing it to a baby or a 89 year old guy?

i very new about scripts and terminal etc.

thanks.
VillasManzanill is offline   0 Reply With Quote
Old Mar 8, 2012, 09:31 AM   #11
jrabbit
Thread Starter
macrumors member
 
Join Date: Jan 2008
Location: St. Louis, MO
Quote:
Originally Posted by VillasManzanill View Post
Hi jrabbit

Could you explain it but as if you were explaing it to a baby or a 89 year old guy?

i very new about scripts and terminal etc.

thanks.
I'm not sure I can do better... which part/parts doesn't/don't make sense?
__________________
MBP 15 (late 2011) 2.4GHz, 6770M, 16GB Crucial RAM, 240GB OWC Mercury EXTREME Pro 6G SSD (HDD bay), 480GB Mushkin Callisto 3G SSD (optical bay); iPhone 4 32GB
jrabbit is offline   0 Reply With Quote
Old Mar 8, 2012, 10:19 AM   #12
dusk007
macrumors 68030
 
Join Date: Dec 2009
Quote:
Originally Posted by VillasManzanill View Post
Hi jrabbit

Could you explain it but as if you were explaing it to a baby or a 89 year old guy?

i very new about scripts and terminal etc.
The stuff in his code that is supposed to make a script just needs to get into a script file.
Launch AppleScript Editor (Spotlight should find it) copy the text. Click the compile button and save it as an Application in some folder where Spotlight and therefore Alfred can find it.
I'd put it into a folder inside the Applications folder or into Applications/Utilities or just straight into Applications.

For terminal stuff. Just open terminal and type exactly the stuff he wrote.
Where he put a $ sign in fron of the line that is terminal commands. The $ is not supposed to be part of what you are typing. It starts with sudo ...
On second glance all the following is also terminal stuff. pico is an editor you might as well edit the file in finder if you can find it. Though explaining how to find a hidden file in finder is probably more complicated than using pico.

The whole sleepwatcher stuff is stuff you don't really need it is just convenience. I only ever used the un/mount scripts and hit it after wake up. Now with my data partition in exFAT I have no spin up problems anymore and don't require any of those scripts.
The best solution is to just kill all apps that cause the spin ups, as well as ntfs drivers and use exFAT for Windows+OSX data drive. Exclude all NTFS drives from spotlight.
No mount scripts needed and it just spins up and down when needed. Only the save dialog is annoyingly always causing a spin up.

BTW learn a bit of terminal. It helps and will make you so much more confident with fixing stuff on your own. In my opinion most people that claim they don't know what to do when a solution is just a little difficult, usually just are afraid because they have this odd notion that a computer is such a fragile thing that breaks at the slightest little thing. People that know their way around computers are simply those that aren't afraid and just try stuff out.
Tipp for terminal.
$ man command
displays the manual for whatever command you need. like "man ln"
$ command -h or command --help
displays usually a short explanation of possible options.

A unix shell usually says nothing if everything worked and only displays errors if something went wrong.
dusk007 is offline   0 Reply With Quote
Old Mar 9, 2012, 09:32 AM   #13
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
Automatic

i already did the applescripts, which i had to change the names of the hdd, i didn't know since it didn't said, so now whoever doesn't know much about this stuff now they know. i think i already installed sleep watcher, i just need to configure it to automatically run the script of unmount every time the computer wakes up, i already added the script to run automatically every time the computer starts. thats the help i need so far. thanks. i just can understand from point 2 of sleepwatcher onward. if you have some time to get in my computer with teamviewer (remote assistance program free) that will be awesome. thanks. you can contact me in trough my website and send an email trough it www.villasmanzanillo.com thanks so much for the script.
VillasManzanill is offline   0 Reply With Quote
Old Mar 10, 2012, 05:32 PM   #14
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
Quote:
Originally Posted by jrabbit View Post
I'm not sure I can do better... which part/parts doesn't/don't make sense?
From point 2 onward of sleepwatcher.
VillasManzanill is offline   0 Reply With Quote
Old Mar 12, 2012, 10:45 AM   #15
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
nada?
VillasManzanill is offline   0 Reply With Quote
Old Mar 17, 2012, 12:02 AM   #16
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
bump
VillasManzanill is offline   0 Reply With Quote
Old Mar 17, 2012, 03:58 AM   #17
Jpalessi
macrumors member
 
Join Date: Dec 2011
Quote:
Originally Posted by visim91 View Post
We can do such things because our Mac's maximum speed remains 3.0 GB/s - also known as "SATA II".
Those with newer models can attain speeds up to 6.0 GB/s - also known as "SATA III"; but, only if they elect to keep their SSD in the main bay, where the SATA III configuration is present.
The optibay, in their situation, is only SATA II; thus, it would be counterproductive to place the SSD there.

This is as far as I know, if I am wrong please correct me.
You are correct but the real life speed difference between II n III is hardly noticeable, which for me does not out weight the safety of having your hdd in the default bay. Plus you can find better deals on sata II ssd's. I have a samsung 470 series in my 13" mbp and it's dumb fast. boots in 2 spins of the wheel.

Quote:
Originally Posted by wikus View Post
Its recommended that you have your SSD drive in the optibay. The main bay has some kind of anti-shock mechanism specifically for HDDs. You'll want to leave your stock HDD or replacement HDD in its default location, which is what I did (120gb Intel 320 SSD in optibay and Western Digital 1TB in the primary bay).
+1
Jpalessi is offline   0 Reply With Quote
Old Mar 18, 2012, 10:31 AM   #18
VillasManzanill
macrumors newbie
 
Join Date: Mar 2012
Please Jrabbit have some compassion for those not so wise like you. Please explain from point 2 on.thx
VillasManzanill is offline   0 Reply With Quote
Old Aug 2, 2012, 11:47 AM   #19
WonkyPanda
macrumors regular
 
Join Date: Mar 2010
now we just need this tweaked for ML
__________________
Former Owner Of:Late 08' UB 2.4ghz C2D MacBook
Mid '10 2.4ghz i5 Macbook Pro
Current Owner: Early '11 2.2ghz i7 HR-Glossy Macbook Pro
GO LAKERS
WonkyPanda is offline   0 Reply With Quote
Old Nov 1, 2013, 11:06 AM   #20
nlynch77
macrumors member
 
Join Date: Mar 2013
I recently posted a similar project here. I wanted to be able to press only the "Eject" button to "turn the drive off" to save power. I am currently doing testing to prove that having the HDD turned off saves significant power.
nlynch77 is offline   0 Reply With Quote
Old Apr 9, 2014, 11:09 AM   #21
imgmkr
macrumors newbie
 
Join Date: Jun 2004
Location: South Korea
Send a message via Skype™ to imgmkr
So, how did test go?

Quote:
Originally Posted by nlynch77 View Post
I recently posted a similar project here. I wanted to be able to press only the "Eject" button to "turn the drive off" to save power. I am currently doing testing to prove that having the HDD turned off saves significant power.
I've just upgraded mine and looking into a solutions for HDD in the second bay.
with OS X 10.9.0
__________________
Live & let live!
imgmkr is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Hardware > Notebooks > MacBook Pro

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
What are the pros and cons of having the HDD in the Optibay? TheJing MacBook Pro 2 Sep 29, 2011 12:13 PM
Spinning down the HD in a SSD/HD MBP sawxray MacBook Pro 1 May 26, 2011 06:51 PM
How to spin down and speed performances on Optibay cosmokanga2 MacBook Pro 0 Sep 16, 2010 01:25 PM
Removing the HDD in the Macbook and replacing with a PATA HDD 7on MacBook Pro 7 Feb 9, 2008 10:24 AM
LCD's to come down in price in the next 2 years? johnbro23 Macintosh Computers 4 Dec 25, 2004 07:44 AM


All times are GMT -5. The time now is 12:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC