Safe Sleep Guide for Mac OS X

Safe Sleep is a kind of sleep mode similar to what Windows users have. It was integrated into the Mac OS X kernel a few years ago and can be enabled through the Terminal. Mac users use the sleep mode often, either letting their computers go into sleep mode after a preset time or manually sleeping the machine. Sleep is especially useful on portable Macs, such as the MacBook or MacBook Pro.
The problem with sleep mode on portable Macs is that is doesn’t always work right. A few times I’ve put my MacBook Pro to sleep and come back later only to find the fans spinning really fast because it didn’t go to sleep properly. It was very hot and I thought it might have damaged the hardware, luckily it was ok. Safe Sleep uses no power and so completely solves this problem because it powers off the computer rather than preserving the RAM state by using a low power state. It does take a little longer than normal sleep but it’s worth it in my opinion:
Pros and Cons
+ Preserves complete system state using NO POWER
+ Restore is faster than doing a cold boot
+ Your laptop won’t burst into flames from screaming fans whilst in a bag
- Takes longer to sleep than normal sleep mode
Safe Sleep mode in action on my MacBook Pro:
Enabling Safe sleep mode is relatively easy, however you need to take come caution, especially if you are using Secure Virtual Memory. Safe sleep doesn’t appear to work if you are using secure virtual memory, but you should take caution if you attempt to enable it.
Safe Sleep can only be enabled under Mac OS X 10.3 (Panther) or 10.4 (Tiger). You should make a copy of the instructions below or print them out, incase you have problems.
Step 1. Enable Safe Sleep
To enable safe sleep on your Mac, the Open Firmware needs execute some code at boot time.
Open the Terminal, enter each line while pressing enter at the end of each line:
sudo nvram nvramrc=’” /” select-dev
” msh” encode-string ” has-safe-sleep” property
unselect
‘
sudo nvram “use-nvramrc?”=true
Restart the computer.
Step 2. Enable Hibernate Mode
To continue, you must have at least as much free disk space as RAM in your computer , plus 750MB.
Therefore if you have 2GB of RAM, you must have at least 2.75GB of free space on your hard disk.
To enable Safe Sleep, in the Terminal enter:
sudo pmset -a hibernatemode 3
This should create the file /var/vm/sleepimage.
If (and only if) you have secure virtual memory enabled, enter 7 (rather than 3) to disable encrypted
hibernation. Encrypted Safe Sleep does not yet work.
Now when your Mac enters sleep, it will now enter the regular Sleep mode first (consuming minimal power). But will
only enter Safe-Sleep if the battery is very low on power, or is unplugged.
To use Safe Sleep mode instead (which takes a bit longer to sleep and wake-up) enter in the Terminal:
sudo pmset -a hibernatemode 1
Enter 5 (rather than 1) with secure virtual memory.
To disable Safe Sleep:
sudo pmset -a hibernatemode 0
You do not need to restart to set the changes for hibernate mode.
Happy lappy sleeping
A big thanks to Andrew Escobar for providing the info