The conversation on this page has been archived and is no longer active.

Applescript to poll mounted drives / force sleeping drives to spin up?

Message #1 - Posted 2005/09/18 - adam.albright

Hi,
I have been looking around for a solution to this, but so far to no avail:

I have an imac with a couple big external drives attached to it. These drives are not used all that often, and spin down when not in use. When an application spins them up (either to use them, or just out of some random need to assert itself), it can take about 5-10 seconds for them to spin up. This delay is problematic when performing some real-time operation like recording audio to disk.

So, what I want is a script that can be run prior to doing a "real-time" task like audio captures. The script needs to ensure that all local drives are spun up, boot off any connected users, etc. In theory, spinning up disks should be easy (just open and close a finder window showing the disk), but I've found that this does not always do the trick. (It must cache recently used folders)

Is there some better way to have the script poll the drives, to ensure that they spin up?
Any suggestions?
Thanks!
--Adam

Message #2 - Posted 2005/09/18 - Jerry Kindall

Previously, <adam.albright@gmail.com> wrote:

Hi,
I have been looking around for a solution to this, but so far to no avail:

I have an imac with a couple big external drives attached to it. These drives are not used all that often, and spin down when not in use. When an application spins them up (either to use them, or just out of some random need to assert itself), it can take about 5-10 seconds for them to spin up. This delay is problematic when performing some real-time operation like recording audio to disk.

So, what I want is a script that can be run prior to doing a "real-time" task like audio captures. The script needs to ensure that all local drives are spun up, boot off any connected users, etc. In theory, spinning up disks should be easy (just open and close a finder window showing the disk), but I've found that this does not always do the trick. (It must cache recently used folders)

Is there some better way to have the script poll the drives, to ensure that they spin up?

Do you want it to spin up "all local drives" or just a list of drives that you use the name of? Here's what I use to wake up my five hard disks -- write an invisible file ".wakey" to the root of each disk. Writes aren't cached so the disk has to spin up for that.

do shell script "touch /.wakey & touch /Volumes/Extra/.wakey & touch /Volumes/Annex/.wakey & touch /Volumes/Music/.wakey & touch /Volumes/Movies/.wakey"

You could do it for "all local drives" if you wanted to ask the Finder for the names of all such disks, loop through them, and write a file to the root of each.

Jerry Kindall, Seattle, WA <http://www.jerrykindall.com/>

Send only plain text messages under 32K to the Reply-To address. This mailbox is filtered aggressively to thwart spam and viruses.

Message #3 - Posted 2005/09/19 - adam.albright

Brilliant! Of course.
This is exactly what I needed, thanks!
--Adam

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.