2

Can I stop hard disk drives from spinning using Terminal?

The reason why I want to know is because I have my Mac to backup at midnight however I do not want my HDD to be spinning all the time. I would also like a way to spin it back up again.

This is an external drive.

4

In a Terminal or script, you can use the pmset command to sleep/wake the computer and more.

From: man pmset

sleepnow - causes an immediate system sleep

sudo pmset sleepnow

Schedules the system to automatically wake from sleep on July 4, 2016, at 8PM.

sudo pmset schedule wake "07/04/16 20:00:00"

Note: I've added sudo to the above pmset commands as this is necessary unless running as root which under OS X is not the norm.

From: Quick Tip: Save Battery by Spinning Down Hard Drive Sooner

sudo pmset -a disksleep 5

sudo - allows a standard “admin” user to run programs usually reserved for the “root” user. These are usually processes that affect the system as a whole – like this one.

pmset - this is the name of the utility we’re using.

-a - this “flag” tells the pmset utility that we’re applying it to all power configurations: battery, charger, and uninterrupted power supply. If you want to affect JUST when you’re on battery power, change this flag to “-b”

disksleep - this is the parameter we want to change: disk sleep time. This parameter is for 10.5 and later; in previous OS versions, you should use “spindown” instead.

5 - this is the number of minutes the system waits before sleeping the disk. OS X’s defaults are 10 minutes. We halved it here, so it spins down faster, but not so fast that it’s always spinning up (which would be counter to our needs). You may need to adjust this number to a point that works best for you.

  • Thanks for answering. How would I do this with a external drive? – iProgram Feb 28 '15 at 20:41
  • I believe the pmset -a disksleep ... command acts on all disks although I do not have time at the moment to test. That said, I at times have several external disks attached to my MBP and they all sleep normally within 10 minutes when not directly being accessed, so yours should as well. Also look at the setting "Put hard disks to sleep when possible" check box and check it if it's not checked in System Preferences > Energy Saver. – user3439894 Feb 28 '15 at 20:49
  • I think it would be useful to run sudo pmset -g first, because that'll display all the current settings (for my Mac Mini, "disksleep" was set to 10 minutes, as mentioned in the answer). – William Turrell May 15 '18 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .