58

I recently got my first Mac computer, a late 2009 Macbook Pro model. I used to put my previous notebook (running windows 7) to hibernate directly in order to save battery but I can't do the same in Mac Os.

From what I can tell Mac Os only hibernate a notebook when battery dies after a long sleeping period.

Is that a way to manually put a Macbook to hibernate?

1
  • 1
    Look at man pmset and pmset -g for some useful definitions and concepts related to this question. Mar 4, 2018 at 17:18

3 Answers 3

19

When a MacBook hibernates, it isn't actually hibernation in the Windows sense. Apple calls it Safe Sleep. The restoration from Safe Sleep isn't meant to be a regularly-occurring event; it's there for emergencies only. From my experience, my Late 2007 MacBook Pro uses such a miniscule amount of power while sleeping (normally) that I have left it sleeping for weeks (while on vacation), opened it up and still had a significant amount of batter power remaining. I'm sure with the new 7+ hour batteries, you could leave it sleeping for months.

To put it quite simply, there's no easy way to save the system state on OS X, besides sleeping the computer and popping the ba-... oh, wait, no more removable batteries.

If you're really adamant about getting this functionality, you can try the Deep Sleep widget. Best of luck to you.

1
  • Cool. Could be years, but I think months is a safe bet :) May 11, 2010 at 17:07
81

Switching the hibernation mode to 25 will make make a MacBook hibernate instead of sleep (see discussion below as to whether it's a good idea).

sudo pmset -a hibernatemode 25

To revert it back to the default for MacBooks do (which powers the ram and writes image to disk)

sudo pmset -a hibernatemode 3

If you want to sleep/hibernate your machine from the command line do

pmset sleepnow

Is it a good idea to hibernate your MacBook?

If your machine supports standby mode, then there isn't much point in changing the hibernate mode, because by default it is in standby after 1.15hrs. In standby mode, the RAM is powered off. On these machines it only takes a few extra seconds to come out of hibernate compared to coming out of sleep. However, standby isn't exactly the same as hibernate, for more details see http://support.apple.com/kb/HT4392

You can also run pmset -g to see whether standby is set and how long standbydelay is. If you don't see standby, your hardware doesn't support this feature.

If your hardware doesn't support the standby feature, then hibernation is an (as mentioned in older posts) "emergency" state, so it's probably best to leave this setting as is. That being said, I hibernate my MacBook before I go away and haven't run into any problems.'

Lots more discussion here Does Mac OS X support hibernation?

9
  • 1
    This is a better answer than the one that is current accepted/upvoted most. It's not as easy to do it on a Mac as it is on Windows, and not possible at all from the GUI (without a third-party app) -- but it is certainly possible!
    – Matt
    Mar 26, 2015 at 20:52
  • 3
    I am not sure this works anymore. I have an iMac running macOS 10.12.4 and it needed to be unplugged for a couple of minutes in the middle of my work session, so I looked into hibernating for the minimum disruption. the hibernatemode 25 command did not give me any sort of error, the sleepnow did appear to take it to sleep (although a bit too fast for hibernation). Unplugging, replugging and powering on though showed a normal startup with programs complaining that they had terminated previously... Oh, well...
    – Ecuador
    May 25, 2017 at 10:34
  • 1
    This doesn't work for me with Sierra 10.12.6 on my mid-2013 Air. pmset tells me the hibernatemode was 3 before and 25 now, but after choosing sleep and waiting for the drive light to go out, just plugging in the power supply made the drive light come back on and pressing a key made the screen light up right away. My boot drive is external and I need to unplug it when hibernated. Aug 17, 2017 at 0:12
  • 2
    Doesnt work on Macbook Pro 2017 with touchbar Apr 9, 2018 at 17:00
  • 1
    Using this is draining battery, it means , it is not a solution on Mackbok air 2017. Nov 11, 2018 at 7:21
6

There's also a preference pane app called SmartSleep (http://www.jinx.de/SmartSleep.html): you have to pay for the current version, but you can find older versions around the Internet.

Also I've used this tutorial, I copied pasted the contents, and have some notes in the bottom: http://www.geeked.info/make-my-macbook-pro-hibernate/

I don’t like to waste battery life, especially when traveling. I love the Hibernate feature in Windows, and have all of my laptops set to hibernate when the lid is closed. The few extra seconds it takes to wake up is worth the saved battery life in my eyes. For those that don’t know here are the different states of the MacBook Pro:

  • On – Computer is awake, screen is on, battery is being consumed based on your power settings
  • Off – Computer is using no power from the battery
  • Sleep – Computer has turned off the screen and has suspended the operating system to RAM (volatile memory).
  • Hibernation – Computer has turned off most hardware and has suspended the operating system to the hard drive.

Usually when you close the lid of your MBP, it will be put to sleep, waking quite quickly when you open the lid again. While sleeping, it’s still consuming battery power, albeit a small amount compared to normal usage. When the battery reaches a certain low level, the MBP will automatically switch to hibernation mode: basically shutting off so you don’t lose any work.

Sleep is great for when you’re actively using your computer, but when you want to stretch out battery life for as long as possible, you'll want it to hibernate. Also note that apparently the newer MacBook Pros also write information to the hard drive when sleeping so that when the battery drops to dangerous levels it can jump instantly into hibernation. Apple calls this “Safe Sleep”. (More info on all the technical stuff here)

A few examples of why you would want to use hibernation with your laptop:

  • You’re about to head to the airport on an international flight and you want to use your machine during the flight but still leave enough juice to be able to pull up a map/email/info when you get to your destination.
  • You toss your laptop in a bag and may or may not use it on a weekend trip but don’t want to worry about charging it.
  • You want to conserve every little bit of power you can.

And when you would want to stick with sleep:

  • Your laptop isn’t running off battery power
  • You will be opening and closing your lid quite often
  • You’re running around but actively using your laptop (conferences, meetings, etc.)

Basically you sacrifice the speed of restoring your machine to gain a little bit of battery power or vice versa. Personally I like to get every last bit of electricity that I can.

After some searching I came across a post that explained how to basically force your MBP into hibernation when the lid is closed. It requires a quick bit of work in a console, but is painfully simple.

In a console, type this command to determine your current sleep mode:

pmset -g | grep hibernate

This should return one of the following:

  • 0 – Legacy sleep mode. It will save everything to RAM upon sleeping but does not support Safe Sleep. Very fast sleep.
  • 1 – Legacy Safe Sleep. This is the Safe Sleep. Everything your laptop goes into sleep, it will save everything to hard disk. It takes some time to go into sleep, and is slow to startup. Slow on Sleep and Startup.
  • 3 – Default. As described above, when sleeping, contents are saved to RAM. When battery runs out, hibernate occurs.
  • 5 – Behaves as 1 but applicable only for a modern Mac that uses "Secure virtual memory".
  • 7 – Behaves as 3 but applicable only for a modern Mac that uses "Secure virtual memory".

Now edit and save your /Users/username/.bash_profile file with the following lines:

alias hibernateon="sudo pmset -a hibernatemode 5"
alias hibernateoff="sudo pmset -a hibernatemode 0"

Note that hibernateon and hibernateoff can be any text you want: you just need to remember what you used.

Now execute the following:

source .bash_profile

Now you have a handy little command that will let you enable and disable instant hibernation on a whim. Whenever you want your machine to hibernate when you close the lid, just drop to a terminal window and type hibernateon. When you’d prefer your laptop to just sleep, type hibernateoff.


.bash_profile (notice the period) is a "hidden" file in your home directory.

Try this command:

pico ~/.bash_profile

and then add the two alias lines.

3
  • 6
    As noted in an answer in "Does Mac OS X support hibernation?": the pmset manual page nowadays claims "don't use anything other 0, 3, or 25".
    – Arjan
    Aug 12, 2013 at 16:16
  • 2
    As of at least High Sierra (probably much earlier), modes 5 and 7 seem to no longer exist.
    – kirb
    Nov 29, 2017 at 3:44
  • It seems that some of the information here might be out of date (0, 1, 3, 5, and 7 vs 0, 3, and 25 as mentioned in Arjan's comment). However, I upvoted this because of the slick alias hibernateon/off trick in the .bash_profile. Nice idea! Sep 13, 2018 at 12:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .