Get rid of your external HDDs' initial lag using Keyboard Maestro

Are you tired of the macOS lag, when you open up an external HDD in Finder (caused by initial spin-up of the drive itself)?

This Keyboard Maestro macro will create an empty hidden file on your external drive and update it’s last accessed date once every 7 minutes, making it constantly spinning and therefore mitigating the initial wake-up lag:

03

Ok, but what about these funny time intervals – you ask. Well:

  • Repeat every 7 minutes – I found out (by trial and error), that my external WD drives go to sleep after about 8 minutes. Setting this value to 7 minutes makes the less amount of writes while assuring that the drives are constantly awake
  • Between 18:00 and 02:00 – That’s the timespan when my laptop is at home and connected to the drives that I want to keep awake. Be sure to set it up in a way that suits your needs.
1 Like

That’s a clever workaround! I take it the external drives don’t listen to the “Put hard disks to sleep when possible” checkbox in the Energy Saver prefs? (If so, good to know it’s not just me then)

A while back I did something similar on the audio side of things by looping a silent AIFF file to keep the sound card from popping when a sound effect or music starts playing.

I think I’m going to adapt this to wake up the drive on demand when I want to start watching things on my Apple TV (Infuse connects to my Mac Mini and streams from the external HDD). As Keyboard Maestro has an iOS app that should work nicely!

(Technically the drive wakes up by itself, but it takes longer than I would like, so waking up the drive manually will probably have better results!)

I think my WD enclosure could “overwrite” this setting on a firmware level (and I had to resort to this macro, when noticed that Put hard disks to sleep when possible setting didn’t work).

On the plus side: with Keyboard Maestro’s macro you can dial in the specific times/occasions when you want to keep your drives spinning (e.g. @RosemaryOrchard’s movie marathons :wink:)

1 Like

FWIW - I have done this for years with a small launchctl service (please don’t hate me KM users - just offering another method):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>local.keepHD23Spinning</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/bin/touch</string>
		<string>/Volumes/HD23/.keepThisDriveSpinning</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>StartInterval</key>
	<integer>300</integer>
</dict>
</plist>

Runs every 5 mins (300) and writes an invisible file (.keepThisDriveSpinning) to keep HD ready. Could also add schedule as desired.

2 Likes