Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Deep Sleep - Put new laptops into hibernation mode Pick of the Week
The macosxhints Rating:

[Score: 10 out of 10]
[This is the Pick of the Week for the week of October 9th]

We've run a few hints here about Apple's Safe Sleep mode, available on all portable Macs since the fall of 2005 (and certain older machines, as explained in this hint).

By default, all new portable Macs use Safe Sleep mode. Most of the time, you won't ever notice it -- if the machine doesn't lose all power while sleeping, it will awaken like usual. But if it does happen to run out of power, when you reconnect it to a power source, it will wake somewhat slower than usual, and with a different onscreen display. That's because it's not actually waking up; it was powered off, since it lost all power. But what you're seeing is Safe Sleep at work, restoring your machine's RAM state from the hard drive, which it wrote out the last time you put the machine to sleep.

Some people, though, prefer to use this "deep sleep" mode, wherein the laptop isn't using any power at all, all the time. To do that, you have to use Terminal to change the hibernatemode value -- not exactly user friendly. Enter the Safe Sleep widget. Install the widget as you would any other, then just activate Dashboard, launch the Safe Sleep widget, and click on it to send your machine into deep sleep mode.

If you decide to use this program, please read the included documentation on how to recover if something goes wrong (though that's not too likely; I've had no issues with the widget).

I don't use the deep sleep mode all that often, so the widget is perfect for me. Most of the time, I just close the lid and put my MacBook into normal sleep mode. But when I want to conserve battery life -- or even more usefully, swap out a dying battery for a new one on a long flight -- I can now do so via F12 and a mouse click.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[34,892 views]  

Deep Sleep - Put new laptops into hibernation mode | 25 comments | Create New Account
Click here to return to the 'Deep Sleep - Put new laptops into hibernation mode' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Deep Sleep - Put new laptops into hibernation mode
Authored by: mabino on Wed, Oct 18 2006 at 8:28AM PDT
I'd give this utility a 9.5 as it stands because of the way the administrative password requirement is handled.

Mac OS typically presents both a username and password field when requesting administrative privileges. This behavior allows someone to run with standard user privileges day-to-day but also provide administrative privileges when necessary.

Speaking more generally, I'm concerned that a lot of Mac developers (I'm looking at you Google) are unintentionally walking us backward into the current Microsoft Windows situation where the Run As feature doesn't always quite work as it should.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: Cochonou on Mon, Nov 6 2006 at 3:48PM PST
Starting from version 0.8 (released yesterday), the widget works on non-administrator accounts.
Thanks for your feedback.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: lokon1979 on Wed, Oct 18 2006 at 10:01AM PDT
if i am not wrong, everytime you close the lid of macbook, it enter safe sleep mode. so if you need to swap battery, just close the lid, wait until the sleep light started to pulse, and you are safe to take out the battery, without any help from 3rd party software.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: robg on Wed, Oct 18 2006 at 10:06AM PDT
Yes, true. Bad example I blame on 2am writing time :). Hence, mostly useful for just those times you want it in hibernate mode without yanking the battery.

-rob.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: mlsmithjr on Wed, Oct 18 2006 at 11:45AM PDT
With the machine in sleep mode, and the battery removed, what's keeping the machine from being powerless?


[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: hamarkus on Wed, Oct 18 2006 at 4:49PM PDT
A small back-up battery, maybe in the form of a condensator.

To clarify, with Powerbooks (back at least to the Pismo) and MacBooks Pro (MacBook Pros ?) when you put them to sleep, you have maybe one minute to change the battery. The maschine will not lose power, it will not go into deep sleep. When you open it up again, it just wakes from sleep normally.

[ Reply to This | # ]
Wallstreet & Pismo
Authored by: Rainy Day on Sun, Jul 27 2008 at 5:37PM PDT
The Wallstreet, and if i recall correctly the Pismo too, have dual battery bays (the CD drive bay is also a battery bay). Even so, it is true that the PRAM battery can power main RAM for short periods of time, if all main batteries are removed.



[ Reply to This | # ]
No, that's wrong
Authored by: soboroff on Wed, Oct 18 2006 at 2:47PM PDT
No, when you close the MacBook lid it goes into normal sleep. The MacBook manual says to shut down before swapping batteries.

If you're running and the battery gets very low, it goes into deep sleep. I don't know if it can switch from normal sleep directly to deep sleep, but I suspect not. (I've put mine to normal sleep, then had the battery run out. In that situation, it has to reboot from scratch.)


[ Reply to This | # ]
No, it does work
Authored by: robg on Wed, Oct 18 2006 at 3:03PM PDT
This isn't true. I just did it myself to prove it. Steps taken, with a never-tweaked MacBook:
  1. Run some apps.
  2. Close the lid.
  3. Wait for sleep light to start blinking (it's solid while RAM is written to disk).
  4. Remove power cord.
  5. Turn machine over, remove battery.
  6. Wait a few minutes, hours, days, whatever.
  7. Put battery back in, plug power in.
  8. Open lid and touch power button.
When you do this, you'll see that the machine doesn't boot from a power-off condition. Instead you see your grayed-out-screen and an odd progress indicator as the machine reads RAM from disk. After slightly longer than usual wake-from-sleep, you're right back where you were before the sleep/hibernate trick.

-rob.

[ Reply to This | # ]
No, it does work
Authored by: clknight on Wed, Oct 18 2006 at 5:35PM PDT
I agree--the "safe sleep" is present by default, and noticeable on my MacBook. If you put it to sleep there is a 30-60 second delay between when the screen turns off and when the HD spins down--during this you will notice the sleep LED comes on solid white but doesn't blink. I presume this is when the RAM gets written to disk.

One problem I've had, though--I've caused a kernel panic on several occasions by triggering the sudden motion sensor while it's writing RAM to disk. It's a little tricky--I close the lid, think it's asleep, drop it onto a pillow on the floor, and 8 hours later it's blazing hot and with the KP screen o' death visible on the non-backlit LCD. Anyone else ever done that?

---
Chris

[ Reply to This | # ]
No, it does work
Authored by: soboroff on Thu, Oct 19 2006 at 6:30AM PDT
Hmm. Ordinarily I skip steps 5-7, and I never have a progress bar when I open the lid. This and the info in the MacBook manual were my sources for my comment.

Perhaps things work this way. When you close the lid, it writes the RAM image but goes into normal sleep. On a critical batter condition, it goes to deep sleep. On wake, if we were in normal sleep, we just start running again. But if we were in deep sleep, we restore the RAM image.


[ Reply to This | # ]
didn't work at first? - look here for help!
Authored by: jspivack on Wed, Oct 18 2006 at 11:49AM PDT
This didn't work at first on my 12" powerbook (1.67GHz): I got the error message "Hibernation file is missing" that is mentioned on page 5 of the documentation PDF. I used the "Enable Safe Sleep" script that I found on this page : http://www.jackoverfull.altervista.org/applicazioni/ , followed by a reboot, and now it works great!

[ Reply to This | # ]
didn't work at first? - look here for help!
Authored by: Superboy on Wed, Oct 18 2006 at 2:40PM PDT
How did you get a 1.67Ghz 12" PowerBook? Apple certainly never made one.

[ Reply to This | # ]
didn't work at first? - look here for help!
Authored by: jspivack on Thu, Oct 19 2006 at 4:21AM PDT
sorry. 1.5GHz

[ Reply to This | # ]
didn't work at first? - look here for help!
Authored by: Superboy on Sun, Oct 22 2006 at 6:41AM PDT
Damn, I thought you may have overclocked it or something... :-)

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: jspivack on Wed, Oct 18 2006 at 11:51AM PDT
I forgot to mention that the website mentioned in section 8 of the documentation to fix this problem, http://matt.ucc.asn.au/apple/machibernate.html , is currently unavailable - probably slashdotted.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: JWiegley on Wed, Oct 18 2006 at 9:07PM PDT
PowerBooks have an internal battery which will maintain power for about five minutes, allowing batteries to be hot-swapped.

[ Reply to This | # ]
Deep Sleep - Put new laptops into hibernation mode
Authored by: JWiegley on Wed, Oct 18 2006 at 9:10PM PDT
Or maybe not... wherever I read that seems to have disappeared. Don't try this at home! :)

[ Reply to This | # ]
Not all powerbooks...
Authored by: germ on Wed, Oct 18 2006 at 10:52PM PDT
have the backup battery. All except the 12'' do. That's why you cannot replace a battery in a 12" without powering down, but you can in any other powerbook.

[ Reply to This | # ]
How to turn off deep sleep?
Authored by: killee on Thu, Oct 19 2006 at 7:24AM PDT
I upgraded from an old 12" Powerbook G4 to a new MacBook Pro... I really notice how much longer the MBP takes to sleep when I close the lid. My old powerbook would sleep in under 3 seconds... the MBP takes at least 20 seconds!

I really don't like this new feature on the MacBook Pro, and I don't want it to write its memory to disk each time I close the lid. I rarely, if ever, leave the computer in sleep mode and let the battery drain... I use my computer all day, everyday.

How do I turn off the deep sleep feature? I want it to sleep faster than 20+ seconds! I wish it would work more like my old powerbook did. [shrug]

thanks,
Kelly

---
http://www.redbeet.com

[ Reply to This | # ]
How to turn off deep sleep?
Authored by: Cochonou on Mon, Nov 6 2006 at 3:38PM PST
Greetings.
If you want to disable the default "fall back to hibernation if ever the battery was to run out of power" behaviour (and therefore make your computer enter sleep quickly), please do the following.
Open up a terminal, and type the following command:
sudo pmset -a hibernatemode 0
You will need to enter an administrator password.

[ Reply to This | # ]
Warning: Multiple clicks bad
Authored by: SeanAhern on Thu, Oct 19 2006 at 10:18PM PDT
Woe be ye who clicks on this widget more than once!

Sometimes, you know how Dashboard widgets take a moment or two to swap into RAM? Well, I clicked the "Deep Sleep" widget a few times, assuming that it was "coming up". Well, it registered all of those clicks, and did a deep sleep for each one.

So my Mac went to deep sleep. Then I woke it up. It then immediately went into deep sleep again. And again. And again. Once for each click I did.

But that's not all! Remember, the way the "Deep Sleep" widget works is to check what the "normal" sleep mode is, remember that, set "deep sleep" mode, sleep, then restore the remembered "normal" mode once the Mac wakes back up again. Well, since the widget was being invoked several times in rapid succession, it didn't have time to restore the default setting of 3 (safe sleep) and the subsequent invocations remembered 1 (deep sleep). So I got stuck in "deep sleep" mode every time I did a normal sleep.

A quick trip to the command line and pmset was able to get me back happy again.

But yeeesh! That'll teach me to be impatient with my widgets!

[ Reply to This | # ]
Warning: Multiple clicks bad
Authored by: Cochonou on Wed, Nov 1 2006 at 6:27AM PST
Well, since the widget was being invoked several times in rapid succession, it didn't have time to restore the default setting of 3 (safe sleep) and the subsequent invocations remembered 1 (deep sleep). So I got stuck in "deep sleep" mode every time I did a normal sleep.
This is something I had not noticed and have overlooked so far. I will think about some kind of protection against this for the next revision.

[ Reply to This | # ]
Wallstreet & Pismo
Authored by: Rainy Day on Sun, Jul 27 2008 at 4:31PM PDT
The Wallstreet, and if i recall correctly the Pismo too, have dual battery bays (the CD drive bay is also a battery bay). Even so, it is true that the PRAM battery can power main RAM for short periods of time, if all main batteries are removed.

[ Reply to This | # ]
Oops! Didn't mean this post here
Authored by: Rainy Day on Sun, Jul 27 2008 at 5:40PM PDT
I hit the wrong link and posted my comment in the wrong spot. Have since posted it above correctly. Admin: Feel free to delete this comment.

[ Reply to This | # ]