Keep your Mac from falling asleep during restore

Sharing is Caring!

Photo credit: https://www.flickr.com/photos/alancleaver/

Restoration from a Time Machine backup can be a lifesaver, but restoring the whole system after booting into Internet Restore can cause some serious issues – especially if that restore takes an extended amount of time.

Normally, the process would be to simply hold down CMD+OPT+R after the BOING and until the spinning globe shows up on the screen, this automatically starts Internet Recovery Mode, and allows you to connect to WiFi or a physical network jack and begin the restore process.  You select “Restore from Time Machine Backup,” select the appropriate image, and away you go.  When the process is finished, your Mac is back to the way it was before your unfortunate incident, with very few exceptions (if any).

There’s a catch though.  Jumping into Internet Recovery Mode also loads the default set of Power Management options, and restoration of a full Mac system these days might take several hours.  Those two factors add up to one massive headache.  Unless you keep the system awake by tapping a key or moving the mouse now and then, the system will go to sleep in about 10 minutes, and start shutting down spinning disks about 10 minutes later.  This means that your – presumably external – Time Machine drive will also get spun down, crashing the restore operation and forcing you to start all over again.

Obviously, it’s just not practical to sit there and keep the system awake for the 6+ hour restore you’re in for if your Time Machine is on a USB 2 disk and is over 500GB or so.  There is, however, a way to force the system to never sleep, even in Internet Recovery Mode.

 

First, boot into Internet Recovery Mode and wait for it to start up.  That will bring you to a screen with a window offering you the basic choices of reinstalling OS X, restoring from Time Machine, etc.  Go to the menu bar at the top of the screen, and choose Utilities, then Terminal.  This closes the first window and brings up a command-line interface (the BASH Terminal) where you can enter these three commands:

 

pmset -a sleep 0

pmset -a disksleep 0

pmset -a displaysleep 0

 

Then quit Terminal via the menu, and walk through the standard restoration operation.

Here’s what you’re doing:

pmset is a function of the underlying OS that handles setting parameters for Power Management options.  In each case you’re telling OS X to set the named Power Management option (system sleep, disk sleep, display sleep).  The “-a” tells OS X to set that option for all power profiles – while you’ll probably only use AC Power during a restore, it’s a good idea to just tell the Mac to use it for all of them.  “0” sets the time-out to zero, in other words never sleep.

The result is that the Mac will never dim the display, got to sleep, or stop the spinning disks until you a) re-set those options or b) boot into another OS instance. Since you’re going to boot into a new instance when the restore is done, you don’t have to worry about changing them back later.

Simple as that!  Open Terminal, type those three commands, and then quit Terminal and walk through the restore process from your Time Machine backup with no interruptions.

9 thoughts on “Keep your Mac from falling asleep during restore”

  1. Thank you. Regarding the Terminal and Bash commands. I am attempting to restore my biz Mac, and it was stopping. I am hoping this was the issue.

  2. My iMac restoration was frozen at the last 5 minutes of restoration and I experience multiple sleep occurrences. Suspecting it could be the issue. Hopefully the above method helps! Thanks!

  3. Thank you SOOOO MUCH! I was certain I’d bricked my 2013 mbp (still running Sierra, to keep 2k design software) while attempting to restore to before Catalina started an install process. I always dl latest OS for the day I have savings to pony up for new subscription software, but this time I obviously didn’t stop it from installing in time because after months of troubleshooting crashes and freezes on startup of even native apps I finally noticed the Catalina install process looping while picking thru console w a fine tooth comb.

    Thank you thank you thank you! Thought for sure this was too obscure a sitch or one specific to too old an os to find joy online. Already surpassed half hr mark that I never reached before. Yay!

  4. This finally allowed me to restore my Mac Mini after 3 failed attempts. My external disk drive kept disconnecting mid-restore, at about 50gb out of 200gb. I was admittedly skeptical of whether the terminal command would help, but it did so thank you!

  5. It is 2020 now and I just used your method to restore my iMac. Many thanks for your post!

    (Before reading this, my external hard drive fell into sleep and the restoration process was terminated.)

  6. useful article, iam trying to recover whole disk via Time machine from network nas, and its realy hard when mac go sleeps and after that NAS close the connection. This solved my issue.

    THANK YOU

  7. Hi Mike

    thank you very much for posting this, it is exactly what I was looking for and saved me an epic endurance test!

    Cheers

    Martin

  8. These three commands finally allowed me to restore my MacBook Pro after several attempts. My external disk drive kept disconnecting around 350GB

    While restoring, I had access to terminal & lost several hours & then did a search which you addressed the very same problem I encountered. I appreciated this info very much. I was very frustrated in starting all over again after losing 9 hours of my time in trying to restore my Mac system. You saved my life.
    Thank you.

  9. THANK YOU SO MUCH. Was restoring my system drive 6 tb over 33 hours and of course it shut down cold after I left the room to whatever the defaults are. Apple really should fix this. Restoring fine now although I’m sitting through 200 gig to make sure. Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.