MacBook/MacBook Pro Hibernation Modes

As a power saving feature of most modern operating systems, you have the ability to save your current system state to ram, go into a power saving mode and consume very little battery power. This is a very convenient feature among portable computer users that are always on the go.

MacBooks have this feature enabled by default and there are three ways to activate it:

  1. close the lid
  2. press option+command+eject
  3. click the apple icon and select sleep

I prefer to save all of the battery life I can on my laptop when I won’t be using it for several days. Sleep mode works very well in accomplishing this goal but we can actually save virtually all of our battery power by using hibernation.

Hibernation will save the operating state to the hard drive and eliminates the need for power at all. This allows us to travel with our computer for several days at a time and not need to plug it up after that extended period to use it.

There are several methods available to activate hibernation mode in OS X. The first method is to put your laptop to sleep, unplug it and remove the battery. This will cause your laptop to enter hibernation mode and you will need to replace the battery and press the power button to wake it. I have a protective case for my laptop to protect it so this method is definitely out for me. The next method is to download one of the several available apps that will do the job for you. This is the easy method but requires no skill and very little effort on your part.

The method we will be using will require us to us the terminal and add a few lines to our .bash_profile file.  Before we begin editing the file, lets talk about the command we will be using.

There are 5 different hibernation modes for the Mac. To find out which mode your computer is using, press command+<space bar> and type in terminal. Select the terminal program from the list and type:

    pmset -g | grep hibernate

This is the output I received:

    hibernatefile    /var/vm/sleepimage
    hibernatemode    3

So what does all of this mean and how is this going to help us turn on hibernation? Below is a list of the different hibernation modes with explanations:

  • 0 – Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.
  • 1 – Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive.
  • 3 – The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.
  • 5 – This is the same as mode 1, but it is for those using secure virtual memory (in System Preferences -> Security).
  • 7 – This is the same as mode 3, but it is for those using secure virtual memory.

Now lets make the changes necessary to switch back and forth from our current mode to a new one. While still in terminal enter the following commands.

    vi .bash_profile

Now add the following lines to this file:

    alias hibernateon="sudo pmset -a hibernatemode 5; pmset -g | grep hibernate"
    alias hibernateoff="sudo pmset -a hibernatemode 3; pmset -g | grep hibernate"

To exit this editor, press esc :wq enter. This will save the file with our changes and we will need to quit terminal and restart it again for our changes to take effect. Once we have restarted the terminal, type hibernateon, enter your password and now close your lid and your computer will enter hibernation mode automatically. To revert back from this new mode, open terminal again and type hibernateoff. This will return your computer to its original mode and the power saving features will work the way they did previously.

Tags: , , ,

No comments yet.

Leave a Reply