Keep your Mac from falling asleep during restore 0

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.