Log in

No account? Create an account
08 October 2007 @ 11:35 pm
Unsafe sleep: Macbook spontaneously rebooting.  
Occasionally my MacBook reboots when I close the lid and drop it in my laptop bag, instead of properly going to sleep. I found this a bit odd, because my old Powerbook was absolutely 100% reliable at going to sleep, but I originally just chalked it up to unreliable firmware on the new architecture and thought it would likely just be fixed soon. But it wasn't. I did notice after a while that it only happened when I was putting my laptop in the bag. Hmmm.

Apparently, the "Safe Sleep" feature is interacting poorly with the "Sudden Motion Sensor" feature. On newer macs, instead of just saving state to RAM (which, in my opinion, was perfectly fine...), they also write the state to disk. This takes a minute or so to do. If you jolt your computer during this time enough to cause the SMS to park the drive, it just reboots, discarding all your state. Of course, the sensible thing for it to do would be to wait for the motion to stop, unpark the drive heads, and continue writing. Or even just forget about writing to disk, and just use the already-saved-to-RAM suspend state. But no, it reboots.

In all the time I've owned a laptop, I'm pretty sure I've never left my computer alone for long enough that the battery runs down and loses the RAM. So, I can't see any real use for Safe Sleep to begin with. But I've lost my state quite a few times now due to this bug. So, here's how to turn off "safe sleep" and go back to good ol' reliable RAM sleep mode.

To disable it temporarily (until reboot):
sudo rm /private/var/vm/sleepimage

To disable it permanently, do the above, and:
sudo pmset -a hibernatemode 0

For some more discussion on the topic, see another blog
(Anonymous) on October 12th, 2007 11:42 pm (UTC)
Thanks for this
My macbook was doing the same thing, and I couldn't work out why. Glad I know now- I don't take it out of the house much so I guess I'll just be a bit more gentle when handling it!

(Anonymous) on January 8th, 2008 07:44 pm (UTC)

I have the same problem!

Thx to tell us what's the problem exactly!
But can you give me more information what I must do so the Macbook never reboots again when I close it and put it in the bag..?
I don't know what to do with these commands you gave me..

"To disable it temporarily (until reboot):
sudo rm /private/var/vm/sleepimage

To disable it permanently, do the above, and:
sudo pmset -a hibernatemode 0"

(Anonymous) on January 7th, 2009 06:00 pm (UTC)
thanks for the info