My internal hard disk would continuously spin on my MacBook Pro and never goes to sleep. I replaced my internal drive on my MacBook Pro with an SSD disk, which made a massive difference in speed. At the same time, I removed the DVD unit and installed a new 500gb drive instead. The extra disk went to sleep when not in use, but then started within a couple of minutes or less. Here’s what I did to fix that problem.
Finding out the culprit
First of all, I needed to change the time before the disk went to sleep. I set the value before sleep to one minute, so I don’t have to wait long between tests.
[cc lang=“bash”]sudo pmset -a disksleep 1[/cc]
The command will set the time for sleep to one minute when using an AC adapter. Replace -a with -b for changing the setting when on battery power.
To find the applications that were accessing the volume, I opened the terminal application and started to observe the output of the following terminal command. To narrow the output, I used grep to just show events and access to the extra disk. Otherwise, you’re going to get a LOT of additional output.
[cc lang=“bash”]ls /Volumes/[/cc]
The command will show you the name of your connected volumes. If the volume name contains spaces, you need to add \ before every space character. For example, let’s say the volume name is Macintosh HD, you need to use
[cc lang=“bash”]Macintosh\ HD[/cc]
Replace name_of_volume with the name of your disk.
[cc lang=bash”]sudo fs_usage | grep name_of_volume[/cc]
Enter your login password. When the disk wakes up, press ctrl-c to stop. The text can scroll pretty fast. Look at the right column for stuff that might have activated the disk.
The first thing I noticed was that fseventsd was logging information to the external disk. To deactivate the logging, just enter the following:
[cc lang=“bash”]cd /Volumes/name_of_disk
sudo touch .fseventsd/no_log[/cc]
I continued to look for applications or processes that accessed my disk, and one of them was iStat Menu. I checked the settings for iStat Menu, and the disk info part was disabled, but it still accessed the disk. So I had to disable it. I love iStat Menu, so that felt a bit sad, but until they fix this, it will be turned off.
Update: Thanks to one of my readers Hextor for finding this. There’s a way to get iStat Menu without the disk continually waking from sleep. Disable the S.M.A.R.T check of the drive.
I have a lot of links for stuff like the download folder, Final Cut Pro settings, buffers for applications and all my photos on the extra disk so naturally, the additional disc will start when using applications using these files. But now when I surf the web or write, I no longer have to listen to the sound of the disk. Blissful silence.
If you don’t need to do Spotlight searches on that disk, you can add the drive to the ignore list in the Spotlight settings under System Settings. Or disable Spotlight altogether.
On my machine, I’ve disabled Spotlight altogether. Found this post with details on how to do it.
[cc lang=“bash”]sudo mdutil -a -i off[/cc]
To enable it, use the same command, but replace “off” with “on” instead.
Disable Time Machine Local Backups
When OS X can’t connect to your Time Machine backup server, the operating system does local backups. That would sometimes start up the disk. After reading this description on how to disable local backups on my machine, the disk never wakes up if I’m not directly accessing it. But if you’re not connected to a backup device for Time Machine, there’s a risk of losing information if something goes wrong, so read the linked article before proceeding.
You can now change the time before the disk goes to sleep. My 7200rpm disk starts very quickly, so I kept mine on a couple of minutes. Added benefit? Much better battery life!
I hope this helps you if you have the same problem.