Main image
31st January
2009

The quick, physical way to hibernate your MacBook.

written by Mark Wheadon

When you close your MacBook’s lid, the machine sleeps. But you’ve probably noticed that it still uses power in its sleep — about 20% of the battery per day, so after about five days it’s flat.

What you may not know is that you can put the MacBook into a much deeper state, where the machine uses almost no power at all. A full battery will then last for months rather than days — useful if you know you’re not going to use your MacBook for a while.

Now, you could install freeware to put your MacBook into this deep-sleep state (often call hibernation) and indeed I have, and it’s good: Deep Sleep. But for the hell of it, here’s a physical way of doing the same, with no additional software required.

Hibernating your MacBook

Check it’s safe to do so

First, close your MacBook’s lid. The illuminated Apple logo on the lid will extinguish almost immediately, but we’re not looking at that.

Look at the light on the front:

MacBook Pro front litIt will eventually start pulsing (breathing 🙂 in its sleep). If that happens almost immediately then sorry, but your MacBook is probably too old for this to work (it hasn’t copied its state to disk), so please don’t carry out the rest of these instructions — you may cause damage.

If, on the other hand, it takes tens of seconds before the light goes from solid-on to pulsing (typically twenty seconds or so) then your MacBook is recent enough for this to work, and you’re ready for the next step.

Let the fun commence

If the power light is now happily pulsing and it took a while to get to that state (whilst the MacBook copied its state to disk) then its time to interrupt the power.

Flip your MacBook over and press the battery-bay latch:

MacBook Pro front unlatchThen remove the cover:

MacBook Pro front cover offand remove the battery, just for a couple of seconds:

MacBook Pro front battery outThen put it all back together and hey-presto, the power light is off and its consuming almost no power at all.

MacBook Pro front not litWhen you next wish to use your MacBook, just open it up and press the power button. (Because it’s off off — really off — you do need to press the power button; opening the lid or pressing a key isn’t enough.) Mac OS X will begin to boot and then show a progress marker while the system’s state is restored from disk:

MacBook Pro unhibernate

After a short while (about 35 seconds on my late-2008 MacBook Pro with 4GB of RAM), your MacBook will spring back to life in the same state as it was when you closed the lid, and with the same battery life!

How’s this work?

Modern Macs do what Windows Vista (for example) calls a Hybrid Sleep whereby it saves its state to disk as well as maintaining the same state using battery power. When you close the lid, the illuminated Apple logo goes off immediately so that you know it’s going to sleep, but actually the MacBook spends the next 20 seconds or so copying its state (mostly the contents of its RAM) on to disk. This is so that, should the battery go flat (and it will do within days, even if it’s full to start with), you won’t lose any data — you just have to wait longer for the machine to wake up once power is restored.

The MacBook then enters a light sleep (usually called standby) whereby the MacBook’s state is preserved by maintaining power to the machine’s RAM, and it’s that power feed that drains the battery.

When you pull the power for a moment, the machine no longer has any live state to preserve and so is essentially off and pulling no power. When you eventually switch it on again, Mac OS X restores its state from the hard drive and everything’s back as it was. It just takes a little longer, that’s all.

Caveats

Here are some things you need to consider before indulging in any of above:

  • You can’t do this on older MacBooks (the clue is in how long the power light takes to reach the sleeping state (pulsing on and off) — if it’s near instant then hybrid sleep isn’t happening and this isn’t going to work).
  • You must wait until the power light is pulsing before pulling the battery;
  • I suggest you don’t do this over-frequently (for example, every day is probably a bad idea) as the battery contacts may not be designed for such a high level of wear-and-tear. (Are there people who remove their MacBook’s battery every day for years on end? I wouldn’t be at all surprised.)
  • Don’t plug in fresh USB devices whilst the Mac is asleep and then wake it from hibernation, as you may find your Mac is less than happy about it.

The software approach

If you don’t like the thought of removing your battery then not to worry — there are several software solutions that will also do the job, and there’s a good guide to them over at Geek Guides.

13 Comments

  1. pao
    01/02/2009

    Amusingly, Apple laptops that support deep sleep automatically drop into deep sleep from normal sleep once the battery is as near as dammit flat.

    Which begs the question: why on earth does Apple not provide a software way to just drop into deep sleep as standard?

    Anyhow for what it is worth, the deep sleep facility works on MBPs since at least early 2007.

  2. DeusExMachina
    04/02/2009

    Apple certainly does provide such a means. Simply go to terminal and type:

    $ pmset -g | grep hibernatemode

    This will tell you what hibernate mode you are in. Mode 0 is simple sleep, like the old powerbooks used. Mode 1 always uses deep sleep, RAM written to disk, etc.. Mode 3 is the new default, RAM powered but also written to disk, standard sleep like on mode 0, but able to restore if power is interrupted. Mode 5 and 7 are the same as 1 and 3 except for cases where secure VM is set in System Preferences.

    To change this setting, use:

    sudo pmset -a hibernatemode (the value you wish to set it to)

    If you set it to 0, you can recover disk space by using:

    sudo rm /var/vm/sleepimage

    Hope that helps someone.

  3. Mark Wheadon
    04/02/2009

    All good stuff. For the purposes of the article I wanted to avoid pmset and keep things entirely physical — hence the visual way of figuring out if the machine is using sleep mode 3 rather than running pmset -g for example.

    People who use sudo pmset -a 1 to make the MacBook hibernate next time it sleeps (and use almost no power) need to remember to run sudo pmset -a 3 next time they switch on, or the MacBook will hibernate every time the lid’s closed from then on.

    But in summary: the software that’s missing from OS X as standard is this: something that tells the system to hibernate now, but doesn’t change the default sleep behaviour — something you click on when you know you’ve leaving the MacBook for a while and you would like it to consume no power in the mean time. The nearest to this that Mac OS X supports is Shut Down… which just isn’t the same.

  4. DeusExMachina
    04/02/2009

    Alternately, one can just use the SmartSleep Pref Pane.

  5. alexkovelsky
    05/02/2009

    Well, there is an AppleScript application to manipulate the way your MacBook sleeps (and it also support “hibernate now” feature):

    rapidshare.com/files/194063472/Set_Sleep_Mode.zip

  6. alexkovelsky
    05/02/2009

    But do not use that on Macs with secure virtual memory [so presumably unticking “Use secure virtual memory” in System Preferences->Security->General will do the trick –mcw]

  7. DeusExMachina
    05/02/2009

    I was under the impression that when secure VM is set and you attempt to set the hibernatemode to an incorrect setting, that it will default to hibernatemode 0.
    Actually secure VM is only an issue in a very small number of cases, since it was only in its first implementation that OSX handled SVM and smartsleep badly. To get around this, Apple added hibernatemodes 5 and 7, which are the same as 1 and 3 respectively, but for secure VM. They write an unencrypted VM image, even if you have SVM selected in preferences. If you refuse to update your OS, the script can easily be made to work by adding a few more if/else statements to include hibernatemode 5 and 7. This should not be an issue with updated OSX.v installs, where hibernatemodes 0-3 work just fine with SVM.

    Easier still, just use smartsleep pref pane.

  8. […] light has stopped pulsing – a sign that it’s still writing memory to disk), you can simply pop the battery to terminate hybrid sleep mode and power-off the MacBook. When you power it on again, it will then resume from […]

  9. 12/03/2009

    I find that when I have my MacBook set to enter deep sleep, it never comes out of it correctly. The machine always crashes.

    On a related note, the MacBook’s started waking itself up for apparently no reason too 🙁

  10. Mark Wheadon
    12/03/2009

    Oli: that could be because you have “Use secure virtual memory” turned on in System Preferences->Security->General? If you have, try turning it off and see if that fixes things?

    I can’t help with the problem of it waking itself up though — unless something’s squeezing the MacBook enough to press a key? 🙂

  11. 22/03/2010

    There is a DeepSleep Widget that will hibernate your Mac or MacBook with one click. Check it out http://www.axoniclabs.com/DeepSleep/

  12. […] Today, 06:19 PM I don't think OSX hybernates like you are used to with windows… it kind of sleeps and hybernates at the same time. To get just hybernate you would want to look into something like this article talks about Hibernating your MacBook, a zero-software approach | Wheadon's Words; Mark's Mutterings […]

  13. JoshS
    14/02/2012

    This isn’t directly related, but if you are interested in battery issues, you should check out low battery saver. It’s an app that makes sure your Mac sleeps before the battery completely runs out and let’s you set a warning to alert you that the computer is about to sleep (lowbatterysaver.com/appstore.html) It won’t fix your battery problems but at least you won’t lose your work, have to restart your computer etc.

Leave a Reply