Mac OS X: Stop external hard drives from spinning up

This is a problem that has been bothering me for quite some time. The symptoms are pretty simple. Every now and then the external hard drives mounted on my Mac can be heard to be spinning up. In addition, this occurrence is not impacted by whether the mac is asleep or running idle. Through a lengthy process of elimination I’ve tracked down processes which can cause the drives to spin up. As a reminder to myself I thought It’s sensible to write some of these processes down. While searching the mac-sphere I noticed it’s a common problem for others, hopefully they may find this useful too.

Time Machine

When enabled, Time machine by default will attempt to backup your entire system. Schedule options in Time Machine are limited, meaning that Time Machine will scan your computer frequently for changes, including your external hard drives. To address this issue you have two options.

Exclude hard drive from scan

First option is that you can exclude your external hard drives from Time Machine:

Open System Preferences > Time Machine

Screenshot display the exclude directory dialog

Once loaded, the Time Machine dialog should display an “Options” button. Click it. The next drop down dialog will present you with a configurable list of mount points and directories which can be excluded from the Time Machine scan.

Simply click the “+” button and navigate to the external hard drive you want to exclude.

Manual Time Machine Schedule

The above option doesn’t help you if the external hard drive which keeps spinning up needs to be backed up. Or worse, if the external hard drive is the drive used for your time machine backups! In that case you may want to look at taking control over when Time Machine decides to do its backups. Reduce the frequency from every 15 minutes to once a day perhaps?

in this case you will have to look at some third party software. One which I’ve used myself and tops the Google search listing is TimeMachineEditor. The way it works is that you disable Time Machine from your system preferences, and instead use this utility to start Time Machine based on your schedule. Further information on how to setup your Time Machine schedule can be found here.

Spotlight

Similar to Time Machine, Spotlight is another process which cab cause your external hard drives to spin up frequently. It is OS X’s instant search offering which can be normally located at the top right of the screen under the magnifying glass. One of the reasons Spotlight performs well is that it is constantly indexing in the background. By default this will include your external hard drives.

Fortunately Spotlight too provides configurable available to exclude your external hard drives from being indexed:

Dialog showing Spotlight's privacy dialog

Open System Preferences > Spotlight

Once loaded the Spotlight dialog should display two tabs near the top of the window. Click on the “privacy” tab. Similar to Time Machine, to exclude an external hard drive click on the on “+” button and select the external hard drive you want to exclude. The selected hard drive should then appear in the list below the search results and privacy tabs.

Wake for Network Access

This one was a little more tricky to identify. Even with the above two exclude options in place I did still notice that my external hard drive would still spin up every now and then, even when the computer was a sleep. After further reading, the system and kernel logs start to become more important. If you’re unfamiliar log files, OS X has an app available in the utilities section called “Console” If you’re not sure where to find it simply type “Console” into spotlight (magnifying glass located at the top right of your screen).

You’ll see that log files can contain a lot of noise. Having knowledge of the times when your hard drives access will become useful in tracking down log entires of use. In my case I stumbled across some “Wake reason” entries:

Sun Dec 04 17:18:28 MacBookPro kernel[0] : Wake reason = RTC

The OS X daily provides a detailed article on what the different wake reason short codes mean. RTC stands for the real time clock alarm which is normally used for wake on demand services. In OS X wake on demand services are usually configured through the energy saver preferences.

Energy saver dialog available from System Preferences

Open System Preferences > Energy Saver

Ensure that no “Wake on…” options presented are selected in any of the tabs available. The type on “Wake on…” options available will depend on the type of Mac you’re using along with your version of OS X. Of course, if you need the “Wake on…” option you might not be able to get around this problem.

Unfortunately, OS X uses these alarms to also include maintenance  jobs on the back of wake up tasks which is the main contributor towards your external hard drive spinning up.

Custom process / schedule

If you’re still having problems we should also take into account your custom system configuration. You should consider what additional applications have you installed on the system? Have you setup any specific scheduled tasks? I hate to say it but you should also consider the possibility of malware of a virus.

One useful command line utility you should take a look at is LSOF. It’s a tool which can be used to list all of the processes associated with a directory. In your case you could run the command while the external hard drive is spinning up. Here’s some usage examples:

lsof | grep ‘THE FULL PATH TO YOUR EXTERNAL HARD DRIVE

lsof | grep ‘/Volumes/Macintosh\ HD’

If you’re unfamiliar with the command line you may want to get your system administrator involved, or at least consider reading up on the basics before making real use of the tool.

To summarise this article is more as a set of reminder notes for me when trying to narrow down unnecessary I/O access to mounted hard drives on OS X. I don’t think it’s a complete list but it’s a great place to start. If you feel there’s some external common process or steps missing feels free to comment. I’m more than happy to update the article as required.

Source: osxdaily.com

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: