2011-05-31

Reduce your HDD spindown time for silent SSD computing

If you've got an SSD+HDD/optibay setup in your macbook, you probably find that the thing is damn near silent when the spinning rust goes to sleep, and the silence is bliss. It's probably also great for battery life too, but I just love having a computer that sounds like it's not even on.

The thing is if you access a file on the spinning rust the drive wakes up, and like a crying baby the damn thing seems like it's never going to go back to sleep. You search in System Preferences, but the only option there is whether or not it sleeps the HDD, not how long it waits, so you put up with it.

Or... you find out that Apple provide some tools called CHUD, which include SpindownHD.app, a utility that allows you to specify how long to wait before spinning down the HDD. In a normal system where your booting off the spinning rust, the 20 minute default makes sense since there's a second or so pause when trying to access a file from the sleeping disk, but when 90% of your frequently accessed files are on the SSD you'd probably rather bring that down a lot. I've set mine to 1 minute and am finding it awesome. I started out searching for a way to manually sleep the hard drive, but a 1 minute spindown negates that for me.

If you've got the developer tools installed already, just run:
open "/Developer/Applications/Performance Tools/CHUD/Hardware Tools/SpindownHD.app"

in terminal and bring the wait time right down.

Apparently this can also be set using pmset as follows:
sudo pmset -a disksleep 1

Developer tools probably not required :D

You can track down any files that are open on the spinning rust using lsof
lsof | grep -i "/Volumes/SpinningRustDriveName"

I found some folders in my Dock were holding open files so I removed them