How To: Quickly Sleep Your MacBook

December 6, 2007

By default, recent Macs ship with their hibernate mode set such that when your Mac goes to sleep, contents of the RAM remain stored in the powered-on RAM in addition to written to the hard disk. The is called safe sleep mode because in the event that your computer loses power during sleep, the contents of the RAM can be read from the hard disk where they were dumped before sleep. This is why it is possible to change your battery while your MacBook is sleeping with this default sleep mode.

That’s all great but with more and more people using 2GB or more of RAM, it takes quite some time for the contents of the RAM to be written to disk and the laptop to begin sleeping. Why is this an issue? For me, I always sleep my MacBook Pro when going from class to class. Waiting a minute or longer (4GB RAM) for the laptop to begin sleeping means I have to wait to put it in my bag or risk damaging the hard drive as it’s busy writing, not to mention the potential for heat build up with the laptop tucked away in my bag. I don’t really care if the laptop enters safe sleep – I don’t change batteries in sleep mode that often anyways and the possibility of the battery just falling out isn’t too great.


Demoing Sleep Mode 0 from Paul on Vimeo.
With mode 0, it takes ~5-10 seconds to sleep compared to ~ 1 minute with 4GB RAM.

In this case, my solution was simply switching the sleep mode to old school mode 0. Everything remains in powered-on RAM and that’s it; no hard drive mumbo jumbo to slow me down. MacWorld has an old but still relevant post about how to accomplish switching between sleep modes.

In a nutshell, your Mac is currently in sleep mode 3 and you want to go to sleep mode 0. Just run the following command in the terminal, enter your password when prompted and test out your fast-sleeping Mac.

sudo pmset -a hibernatemode 0

Just don’t blame me if your battery does actually fall out while your mode 0′d MacBook is sleeping and you lose your session data. Will you try out this sleep mode for speed or are you more concerned about “what if” cases and like your RAM dumped to disk before entering sleep?

Now, if only there was a terminal command I could run so the optical drive stopped making that stupid sound everytime the computer wakes up.


  • Get notified of new posts by RSS or email.

{ 30 comments… read them below or add one }

Dileepa P December 6, 2007 at 6:13 pm

Windows has had hybrid sleep support for Laptops for a long time now. It’s the best of both worlds.

But once Apple implements this feature in Mac, it will be big news. I am sure it will be one of the 600 features in the next OS X release.

Reply

Sam Lu December 6, 2007 at 6:34 pm

Thanks for the tip! I didn’t even know the OS was trying to write stuff to the HD as it was going to sleep.

Reply

Ronald Heft December 6, 2007 at 7:09 pm

It should be mentioned that unlike Tiger, Leopard changes the power profile settings when disabling safe sleep. This means your battery power settings will no longer read “Better Energy Savings” or “Better Performance” and instead will read “Custom”.

There is no harm in that, as your original settings remain, it’s just important to note that then changing the profile will reset the safe sleep setting back to 3 (enabled). If you need to mess with your power settings, do it through the Energy Savings preference pane.

I found out this the hard way after fighting with Leopard for a couple weeks until I realized what was turning on my safe sleep again.

Reply

Anthony D December 6, 2007 at 7:12 pm

I’m sorry, Dileepa, but Macs do have hybrid sleep support for laptops, that was what Paul was talking about here.

Reply

Duncan December 6, 2007 at 7:41 pm

I think I will put up with the delay for the safe sleep.
Thanks for the tip though.

Reply

Blake Brannon December 6, 2007 at 8:28 pm

If I had a MacBook I would totally do this. When I hear the lid “click” it should be done writing to the HDD. Like you I am always in a hurry and can’t wait a full 30 seconds to put it in my bag.

I have, on more than 100 occasions, put my POS Windows XP system in my bag only to find that it never when to sleep! What give? Over all the times it happened to me, i’ve only lost one HDD.

Reply

tnpr569 December 6, 2007 at 8:56 pm

Paul- your MacBook (Pro) makes that sound when it wakes up, too? Mine is so much louder than my friends’ Macbooks, but from your post it seems that I’m not alone in my “plight” :-P

My MacBook sometimes decides it doesn’t want to wake up, and it takes a few openings and closings of the lid and some random key mashing for it to work…but it wakes up eventually.

It’s still better than my last Windows laptop that decided to “eat” some of my class notes when I woke it from sleep. I think that was the last straw for me with regard to Windows.

Reply

Taylor Olson December 6, 2007 at 9:25 pm

Paul! I love this post. I cannot believe I hadn’t heard of this. Solved so many of my problems!

Reply

Indraneel Purohit December 6, 2007 at 9:31 pm

I was going to do this, but I’m scared of losing my MacBook. I’ll pass this time around, but overall a great little tweak.

Reply

Michael Yurechko December 6, 2007 at 9:47 pm

Very cool tip, thanks paul.

btw. Is that some Shiny Toy Guns I heard playing at the beginning? Sounded like “You Are The One”.

Reply

Nick December 6, 2007 at 11:10 pm

Awesome tip, thanks!!

Reply

Justin Cady December 7, 2007 at 12:07 am

Excellent tip. When leaving for class I rarely have time to go through a slow and methodic process of putting my laptop away. I just grab it and go.

Reply

Sebastian December 7, 2007 at 12:08 am

I really don’t like that stupid sound that the optical drive makes when waking up. Lightroom triggers that sound as well when it launches the import dialogue.

Reply

Nathaniel Buck December 7, 2007 at 12:31 am

Thanks for the great suggestion Paul. This will help when I’m using my MacBook around campus.

Nice insight @Ronald Heft.

Reply

Gonzague Dambricourt December 7, 2007 at 9:08 am

Regarding the optical drive, if you have a way to permanently disable it , I would be so happy :)

Reply

Stephen Fleming December 7, 2007 at 8:37 pm

Did this months ago, and it’s a good tip.

Also, I disabled the “wake when lid opened” while I was fiddling with pmset, so I have a chance to plug in Ethernet and USB cables before the machine wakes up.

Finally, if you don’t know already, Command-Option-DiskEject will put the machine to sleep instantly. (Unlike what some sites say, you don’t need to hold that combination down for 2 seconds; just hitting it quickly is enough.)

So with hibernation disabled (it’s basically useless for me), I can hit those keys, slam the lid shut, and have my MBP in my briefcase right *now*, instead of waiting around for thirty seconds for the light to start blinking.

Yes, we’re impatient. :-)

Reply

Adim December 8, 2007 at 1:30 pm

Nice very helpful

Reply

Rory December 10, 2007 at 11:30 pm

Thanks for the tip, Paul. I just changed to mode 0 on my 2GB MBP and I like it. Waiting around for that light to start flashing before moving the computer was starting to annoy me.

You would think mode 0 would be the default, considering that after closing the lid, most people are going to pick up and move their macbook EXACTLY when they shouldn’t be (when the disk heads are busy writing RAM contents). I wonder how many failed hard drives this has led to?

And, just to be clear, the ‘worst’ that is going to happen should your macbook lose power when in mode0 sleep, is that you’ll lose whatever unsaved data you had running in applications when you put the computer to sleep, correct? You’ll just do a fresh boot when you power it back up. Some commenters above seem to think you’d be risking the entire computer or something.

Thanks again!

Reply

Chris Marshall December 11, 2007 at 2:27 pm

Guess I am happy for once that I have a slightly older MacBook!

Reply

Jack Pearce December 11, 2007 at 4:41 pm

Thanks for the tip Paul, oh and teaching me something new about how OSX works.

Jack.

Reply

Paul Stamatiou December 11, 2007 at 5:57 pm

@Chris – this isn’t a recent thing. It has been the default sleep mode (mode 3, the one I’m trying to avoid for sleep speed) for all Macs since ~fall 2005.

Reply

Michael Lippa March 25, 2008 at 3:03 am

Thank you so much for this Tip. I Just bought a new MacBook Pro today and i was confused at why with so much more power over my old MacBook, why it was taking so much longer to go to sleep. This Helped allot as i too sleep my notebook between classes. I Always have juice in my battery, and i frequently save my work, so i don’t think ill have to worry about loosing anything from running out of power.

Reply

Kiran April 4, 2008 at 4:47 pm

Hey paul! I see immense potential in you :) I wish every 21 yr old is on the same page with u … much more efficient future ;)

Anyways I just tried this tweak, works great! I am sure battery charge would be the same once it wakes from the sleep mode….

Thank a lot buddy :)

Reply

Ashley July 25, 2008 at 5:21 am

Thanks for this…..I found this info somewhere on the day I got my macbook, but then a few days later I changed my energy settings from the top bar and it reverted. So don’t do that, you will wonder why sleeping takes so damn long again! ;)

Reply

flynn November 3, 2008 at 5:25 pm

Download and use SmartSleep. Much better – fast sleep while battery full, hibernate when it gets empty.

Reply

Robin Barooah November 3, 2008 at 7:09 pm

Is there really a problem here that needs this setting? I never worry about putting my (HD Based) MacBook air into its bag and walking off, and I never did with the MacBook pro I had before it.

Recent Macs all have motion sensors which they use to protect the hard drive when you’re moving about so I’m not sure how much of a risk there really is.

I suppose that if you’re moving around too much for too long, and it’s really unable to write the data back to the drive, there might be a heat build up, but even that shouldn’t be too servere given that the CPU and drive activity will be minimal while it’s waiting for you to stop moving.

Furthermore, Mac’s have thermal cutouts to protect key components. If too much heat really does build up and the CPU is in danger, it will cut the power completely. Yes, you’ll lose the contents of your RAM, but the computer itself should be fine.

As I say, I’ve never experienced a problem with just putting the computer in a bag and walking off – it can take care of itself!

I’d be interested to know if I’m just lucky, of if other people have actually had problems with either overheating, or drive failure in this scenario.

Reply

der Dennis November 4, 2008 at 3:38 am

There is an even easier and smarter way to do this. Use the SmartSleep PrefPane. It lets you choose between sleep, sleep & hibernate and hibernate only. Even based on remaining battery level. So you have the best of both worlds.

Highly recommended!

Reply

Dan November 6, 2008 at 12:03 am

Yet another utterly obscure and utterly useful thing. Oh, how I HATE the Apple meme of not documenting the parts that really matter on the grounds that real users don’t care..

Prithee, how did you find this? Better still, where can one find a thorough compendium of all the tweaks that are evidently possible?

And, of course, thanks for this.

Reply

Adi Chandra December 6, 2008 at 3:57 am

how about the SSD version of Macbook Air. since it has no moving object in ssd, is it safe just to use the default hibernate mode, and take the computer up when the light isn’t pulsing yet.

Reply

Jason July 1, 2010 at 11:33 am

@Adi: Yes, a laptop with an SSD hard-drive can be moved about with no possible damage to the SSD, since there are no moving parts.

Reply

Leave a Comment

{ 7 trackbacks }

Previous post:

Next post: