Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Avoid Western Digital external drives' built-in spin down Storage Devices
A problem with some of the Western Digital's My Book external hard drives is that they have a spin-down functionality built into their firmware. Meaning that no matter what preferences are set in System Preferences, if 10 minutes of inactivity have passed, the hard drive will go to sleep. This is annoying, as even if you are browsing files in the Finder without looking at the ones on the hard drive, the Finder triggers a spin-up, and then bogging down the system until the hard drive has finished spinning up.

A workaround for this is to not let the hard drive be inactive for more than five minutes by constantly touching a hidden file on the hard drive. This is done by first building a small script in bash that touches the hidden file and that also checks if the hard drive is mounted, so as to not flood the system logs if the drive isn't connected. Here's that code:

#!/bin/bash
# Used to not let a volume named MYBOOK sleep

volpresent=$(mount | grep MYBOOK | wc -c)

if [ $volpresent -gt 0 ]
then
    touch /Volumes/MYBOOK/.hiddenfile
fi
This script should be made executable by running the following on the Terminal: chmod +x ./no_sleep_script.sh. Replace no_sleep_script.sh with whatever you named the script. The best way to run this script every five minutes is to use the launchd system built into Mac OS X, and a donationware app called Lingon is a great tool to manage it.

Install Lingon, then build a new Agent in the My Agents category, choose a unique name for it (such as com.username.agentname), input the location of the script, and tell it to run it every five minutes. Save it and restart your session. I've done this and the drive has remained sleepless since.

It can be argued that this may shorten the life of the HD, but from what I've read in various forums, having the HD spinning down and up constantly also causes severe strain on the HD, especially in situations like mine where the HD is constantly on. DISCLAIMER: This is not really my hint, but a variation of someone else's, but I don't remember where I got it from, sorry!
    •    
  • Currently 2.54 / 5
  You rated: 1 / 5 (13 votes cast)
 
[52,593 views]  

Avoid Western Digital external drives' built-in spin down | 31 comments | Create New Account
Click here to return to the 'Avoid Western Digital external drives' built-in spin down' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid Western Digital external drives' built-in spin down
Authored by: tbolioli on Mar 18, '09 07:57:54AM
It can be argued that this may shorten the life of the HD, but from what I've read in various forums, having the HD spinning down and up constantly also causes severe strain on the HD, especially in situations like mine where the HD is constantly on. DISCLAIMER: This is not really my hint, but a variation of someone else's, but I don't remember where I got it from, sorry!
This is false. Power management features don't wear down the parts any more appreciably over time. I have a MyBook Pro and I don't mind the spin down. In fact, I am happy I have it because instead of paying $50 a year to run the device, it costs me less than $10. YMMV based on usage patterns and energy costs.

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: randalla on Mar 18, '09 08:10:48AM
I effectively did something very similar to this to make that damn drive not spin down (it's where I store all the files I serve to my PS3...so it was really annoying).

My solution was not to write a script, but rather to just call touch on the hidden file directly through the launch agent. Here's the plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.xaren.touchApollo</string>
<key>ProgramArguments</key>
<array>
<string>touch</string>
<string>/Volumes/Apollo/.touch</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>

My MyBook drive is called Apollo. Since I'm not overly concerned about logging, if the drive isn't there then I'm not terribly worried about any log messages this may produce.

Save the file in ~/Library/LaunchAgents and either load it using launchctl load /path/to/agent.plist and you should be good to go.

I figured out my solution when I needed it. The above solution is better than mine, but I thought I'd share anyway :)

Adam.

---
Xaren Development
http://www.xaren.net

[ Reply to This | # ]

Avoid Western Digital external drives' built-in spin down
Authored by: Anonymous on Mar 19, '09 11:25:51AM
Instead of touching /Volumes/Apollo directly, you could avoid any logged errors by saying [[ -w /Volumes/Apollo ]] && touch /Volumes/Apollo. I wonder if you need to wrap each "word" in a separate "<string> .. </string>" clause.

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: EricF on Mar 18, '09 08:52:41AM

I'm just wondering... would this solve the problem I've been having where if I boot from my WD external drive, I eventually get a panic because the OS assumes the drive is spun up, when in fact the drive has spun down, and a timeout occurs waiting for the drive to become ready again?

If that's the case, this hint will be incredibly useful!

Thanks!

-Eric



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Andreas. on Mar 18, '09 09:48:09AM
See the link I give below which might explain your booting problem.

Andreas

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: asmeurer on Mar 18, '09 09:07:19AM
In addition to this, I believe that the screensaver will wait for the hard drive to spin up before it will let you type your password, which is really annoying.

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: sfgecko on Mar 18, '09 09:29:00AM

have you tried setting the pmset disksleep parameter? this sets the spindown time for all disks including many external hdd's.



[ Reply to This | # ]
spin down
Authored by: arizdave on Mar 18, '09 09:35:50AM

I'd like to know how to do the opposite. I have an external (non- western digital) USB drive that I use for time machine backups that automatically backup every hour. 59 minutes of every hour the HD just keeps spinning and producing heat. Love to have a simple auto spin-down program for this drive.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Andreas. on Mar 18, '09 09:45:25AM
For more info about WD and their drives...

Western Digital drives   !   AVOID   !

Andreas

[ Reply to This | # ]
No, don't avoid them!
Authored by: fmaxwell on Mar 18, '09 01:00:12PM

WD currently makes the best disk drives available. I will be happy to trade my 1TB Seagate 7200.11 for a WD Caviar Black 1TB -- and I'll pay the postage.

My WD My Book Studio is a fantastic drive for Time Machine backups, which is how I use it. That it spins down is a great thing. It keeps noise and heat down and saves wear and tear on the drive.

If you want a bootable backup, then get a bare WD Caviar Black SATA drive, put it into a drive sled, and slide it into position 2, 3, or 4.

If you don't have a Mac Pro, I don't care, because apparently we are supposed to make blanket recommendations to buy/avoid products without considering that someone else might have totally different needs than ours. ;)



[ Reply to This | # ]
Don't avoid here either
Authored by: dan55304 on Mar 19, '09 07:11:34AM

I've tried all the removable drives. The only ones still running flawlessly after a year are WD. They are now the only drives I buy.



[ Reply to This | # ]
Don't avoid here either
Authored by: fmaxwell on Mar 19, '09 10:00:31AM

WD currently makes the best bare hard drives, too. I'd probably put Samsung next. Seagate I'd put dead-last. They seem to have decided that price is the most important consideration, so I'd rather pay an extra $30 and get the reliability and speed of a WD drive.

I have a Mac Pro that came with a 1 TB Seagate 7200.11 series drive already installed. The reliability on those drives is so bad that I bought a WD Caviar Black 1TB drive. The Seagate is now my screwing-around-on drive, with multiple custom-configured copies of OS X and Windows (e.g., for things like diagnostics, drive copying, "rescue" in case my primary drive gets filesystem damage, etc.). An added bonus is that the WD is faster.

I realize that I was kind of harsh to the other poster, but I'd really rather see some more nuanced discussions rather than Chicken Little sky-is-falling stuff. Okay, maybe the WD won't work well for him in his very specialized intended use as a Mac boot drive, but that's no reason for alarmist postings telling everyone that they should avoid WD drives.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Anonymous on Mar 19, '09 11:39:43AM

Andreas, could you please be more accurate, rather than just hurling out a big tabloid-style horror story?

The thread you wrote on Bombich's forum clearly states (in big letters and pretty colours) that the advice only applies to their external drive units. You don't say why, but link to another thread that explains that WD "MyBook" drives have a logic board assigned to SCSI LUN 0, whereas Macs always (?) expect the drive to be at LUN 0. This apparently prevents Macs from booting from those drives.

But thanks for the advice -- I'll make sure I put a label on my cheap "MyBook" drive so that I don't go using it as a bootable backup. It won't -- fortunately -- be in several colours and font sizes.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Unsoluble on Mar 23, '09 09:41:53AM

I won't speak for others or make generalizations, but my original 500GB MyBook Pro failed after about a year (losing all data), and then the replacement they shipped under warranty failed about six months later (again, losing everything).



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: EricF on Mar 18, '09 10:27:54AM

Thanks for that information, Andreas!

I remembering reading somewhere not to boot from WD external drives because of the spin-down issue. I was able to boot from mine, but it would gray-screen after being idle from a while (like overnight), which I thought was from the spin-down issue. I've been avoiding WD external drives as boot drives just because of this (good thing too!)

Now WD says they won't support booting from their external drives... even though their doc says they do. Pffffffffft! I hope that little tidbit of information gets out into the mainstream Mac press. Sounds like they're too lazy to explain or address the actual issue.

I may try the prevent-spin-down technique, just to see if it addresses my particular problem. If not, I guess I'll have to find another external drive. I've been using their internal drives for a while with no problem :)

Thanks again!

-Eric



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Andreas. on Mar 18, '09 11:12:39AM
EricF:  I hope that little tidbit of information gets out into the mainstream Mac press
I couldn't agree more - that's why I am posting where appropriate. Please do the same. At the Bombich forums we are constantly hearing of users who have been bitten. A few vendors have exchanged a WD drive for another make, but many refuse to do so. Note that the difficulty with booting is not quite due to the 'auto-sleep'/spin-down "feature" - it's due to the commandeering of LUN0. See the link in that thread to the explanation by 'baltwo'.

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: EricF on Mar 18, '09 11:22:00AM

If it's a LUN0 problem, then would you be able to boot of the drive at all? I can boot from it, it just crashes after a while.

Oh well... onward...

Thanks!



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: NB on Mar 18, '09 12:10:41PM

I'll probably be the first to try to argue it's *not* a good hint. It's an OK (and maybe the only) workaround to an annoying behaviour, but IMHO, that's not the way it *should* be fixed.

What's actually wrong with the HD spinning down? The Finder lags for several seconds when it spins up? Well, isn't it a bug in the Finder? Shouldn't the Finder cache the contents of the folder? If it's a local volume, its contents is not going to be modified without the system being noticed, so it's possible for the Finder to pre-list the contents of some folders in the hierarchy, in order to be able to display it while the disk spins up.

Maybe in snow leopard



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: zkarj on Mar 18, '09 08:10:22PM

I have a Seagate FreeAgent that has the same problem. The Finder DOES cache folder contents which is, I think, what lead to a tip very similar to the above trashing my drive!!

I can't prove it, but be warned that within 24 hours of setting up a touch script on my drive, the dreaded 'invalid b-tree node size' error occurred and I had to purchase a disk recovery tool to get my data back.

In my case the damned thing spins down after 60 seconds! I tried the manufacturer's only suggested resolution and updated the "drive manager" software "to let the OS handle spin down". Great idea, except it doesn't work.

Worst of all, is when such a drive is connected to an Airport device and it's spin down is not recognised by your local OS so it assumes the drive is offline and CACHES THAT FACT in such applications as iTunes, so that you have to quit iTunes, use Finder to spin the drive up and then restart iTunes to get it to read the drive.

All this basically makes the "convenience" of external drives a massive inconvenience. When I get time I shall be researching well behaved third party enclosures and I will re-home all my drives to such.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: bedouin on Mar 18, '09 08:40:58PM

Fixing your Free Agent is pretty simple if you have access to a Windows machine. All you have to do is use Seagate's software utility to disable the power settings in the firmware. Once you do that all the annoyances are gone.

As for the WD drives -- I have two 500gbs. One of them was attached to an iMac running Linux with a touch script applied; it died a very strange death. I have another 500gb WD on an OS X machine with the same script and it's still kicking.

I kept the empty enclosure from the WD drive, but I'm kind of weary of putting another drive in it.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: irc on Mar 18, '09 08:55:57PM

I'm fairly new to the Mac world, but I thought an advantage was BSD under the hood. In this case: why use launchd and add yet another app to your machine to control access to it when you can just add a cron job that calls your bash script every 5 minutes? That's my Linux mind solving the run-it-periodically problem.

I ask because maybe I'm missing something Mac-cool here. Like cron is heavyweight on system resources and launchd is some super-light thing.

Or is it just a personal preference choice?



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: BiL Castine on Mar 19, '09 04:16:16AM

Launchd is Apple's replacement for cron in 10.5, and is always running.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: bedouin on Mar 19, '09 01:22:23PM

What's bullshit is that Apple disabled user crontabs in 10.5. Well, sort of.

If you're a user and type crontab you'll be able to set one up, but it will be dead the next time you reboot, even though it still shows up in the crontab.

The only crontab that sticks after reboot is root's. Launchd is a lot of work for what takes one line with cron, and I don't care what it's awesome benefits are.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: irc on Mar 19, '09 08:13:42PM

Thanks guys. I went a did the crontab thing last night after reading this and went to bed wondering why on earth I'd need to do more than:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * ~/Documents/Scripts/keep_drives_alive.sh

I just checked. My computer was off for the past 15 hours or so. And the timestamps on my .hiddenfile files are up-to-date. So crond did start on boot and ps confirms this:

my-imac:~ me$ sudo ps -ef | grep cron
0 22 1 0 0:00.01 ?? 0:00.01 /usr/sbin/cron
501 528 493 0 0:00.00 ttys000 0:00.00 grep cron

And:

my-imac:~ me$ date
Thu 19 Mar 2009 23:11:09 EDT
my-imac:~ me$ ls -la /Volumes/Storage/.hiddenfile /Volumes/Time\ Machine\ Backups/.hiddenfile
-rw-r--r-- 1 me staff 0 19 Mar 23:10 /Volumes/Storage/.hiddenfile
-rw-r--r-- 1 me staff 0 19 Mar 23:10 /Volumes/Time Machine Backups/.hiddenfile

Computer has been on for about an hour now. Maybe a change of heart on the disabling of crond on boot on Apple's part?



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Seth Milliken on Mar 23, '09 02:08:55PM

FYI, you can specify "every 5 minutes" in cron with "*/5" in the minute field.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: irc on Mar 25, '09 07:37:53PM

Very nice tip. 15 years using cron and I've been writing it out long hand the entire time.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Sesquipedalian on Apr 29, '09 06:23:23AM
I've created a little applet based on this discussion. It allows the user to implement randalla's method (posted above) without having to muck around with editing anything. Just click the "Keep a drive awake..." button, choose a drive from the list, and click "OK". To undo, run it again and click the "Let a drive sleep..." button instead.

Keep Drive Spinning can be found at http://www.macupdate.com/info.php/id/31158

[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Anonymous on Apr 29, '09 07:46:16AM

Thanks i found your script the other day by accident.....

I have a few (low budget) sites using Softraid, since we started using WD drives as a 3 way mirror on rotation they kept going out of sync. The internal drive and 1st external is in sync but the WD drops connection so putting it out of sync and making the RAID rebuild.

This so far has stopped the problem so thanks....did not think to keep the drive alive using launchd...cool...as i could not work out the problem.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: SOX on Nov 19, '09 07:02:39PM

the above plist seems to be out of date. however this works:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.xaren.touchApollo</string>
<key>ProgramArguments</key>
<array>
<string>touch</string>
<string>/Volumes/Crashplan/.touch</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>

to use this copy the above to /Library/LauchAgents with some name like com.xaren.touchApollo.plist

then run
launchctl load /Library/LauchAgents/com.xaren.touchApollo.plist

to run it.



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: Goppy on Jan 04, '10 06:30:41PM

I have WD Caviar 500 Gb installed in a generic enclosure with USB connection connected to G5 2Ghz Dual PowerMac. Sometimes it appears immediately on the desktop other times not. When connected and Time Machine starts it sometimes runs perfectly and on other occasions runs for a while then powers down. I have read here and elsewhere about the compatibility issues with WD HDs and also problems with USB connections on external hard drives connected to Macs. Is there a fix for the problem as described or alternatively would the problem be more easily resolved by buying a different manufacture HD or a Mac preferred ext HD such as LaCie or others with Firewire connections? (I am not tech savvy enough to write new software commands)
Many thanks



[ Reply to This | # ]
Avoid Western Digital external drives' built-in spin down
Authored by: MelbourneAus on Jan 24, '10 02:14:35PM

Hi All,

This is my first ever post, so please be nice...

This post is most relevant to me as I have the same problem with my WD drive. While a lot of the code doesn't make sense to me, I do know my away the machine relatively well. Could I trouble someone to really step out the precise process I have to follow so I can get this to work for me. I'm hoping someone out there has the time and patience to help a lay man like me.
Best,



[ Reply to This | # ]