Hibernate Mode in Mac OS

I had not known that Mac OS has hibernate mode (which is called Safe Sleep mode) until I read a post on the Internet. Basically, when Mac OS is put into sleep mode (by closing the lid, choosing Sleep in the Apple menu, or by pressing and holding the Play/Pause button on the remote control), it goes to Stand-by mode where the computer is still on. If the power source is lost and the battery is under a threshold level, the computer automatically changes to Safe Sleep mode where the contents of the RAM are written into an image file on the hard disk and the computer is off. Next time when the computer is turned on, it will recover the RAM from the hard disk and goes back to the state where you put it into sleep. That’s cool, huh!

However, sometimes you really need to put your computer into Safe Sleep mode immediately. For example, you are doing some work and want to go back home with the computer without having to close then open all your applications and documents you are working on. In this case, you need to force Mac OS to put the computer into this mode. The trick is to use the command “pmset” on the terminal. Basically, you run:

sudo pmset -b hibernatemode 1

if you want your computer always go to Safe Sleep mode anytime it sleeps on battery (that’s why the -b). Change -b to -a if you want to set this behavior for all power modes. You can reset the hibernate mode to the default setting by running

sudo pmset -b hibernatemode 3.

For more information, refer to the manual (man pmset). Also, the following aliases (in your .bash_profile) may be helpful:

alias hibernateon="sudo pmset -b hibernatemode 1"
alias hibernateoff="sudo pmset -b hibernatemode 3"

Advertisements
This entry was posted in MacOS and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s