Q: prevent sleep when booted in recovery mode or from usb drive?
I like to boot my mac in recovery mode (or from an external usb) so that I can do a clean disk copy and make a clone of my entire drive while nothing is running from it. I attach an external firewire or thunderbolt drive, and use DiskUtility to copy the disk. This used to work great pre 10.8, but now the system goes to sleep part way into the disk copy, thereby interrupting the process. This is very annoying. I've searched other threads and found a couple people who asked about this and got responses w instructions on using the energy saver system preferences panel, but that doesn't help, because the energy prefs panel is not available in the minimally-configured recovery-mode version of 10.8.
Any ideas how to keep the system from sleeping?
MacBook Pro, OS X Mountain Lion (10.8.2)
Posted on Oct 19, 2012 5:50 AM
I think I found a way to solve your issue:
http://apple.blogoverflow.com/2012/07/interesting-new-unix-commandsbinaries-in-o s-x-mountain-lion/
The command you're looking for is caffeinate. Just open a Terminal window and execute.
I just invoked the command to keep a file copy (from my previous Mac's Time Machine volume to my new system's hard drive, as opposed to its SSD) going overnight. Prior to this, I had to babysit the system to keep it from falling asleep and pausing the file copy. The true test will be whether my computer is still alive and copying an hour after I hit the Add Reply button here...I'll report back if it works/doesn't work.
I would have invoked the command-specific option of caffeinate, but the file copy has been running for awhile, so I just told my Mac to caffeinate itself for 36000 seconds (10 hours). Should be enough to cover me for this action. I imagine that you'd have to use the timed version of caffeinate for anything running through the GUI, since I haven't yet found a way to invoke, say, Disk Utility from the Terminal.
Posted on Nov 1, 2012 10:12 PM