Mac OS X Hibernate / Sleep mode
I was not aware of it, but by default when your Mac goes to sleep mode (you close the lid of the laptop, or power saving kicks in, etc.) it does in fact save a hibernate file (/var/vm/sleepimage) first, and then goes to standy mode (thus the computer is on, it just stops running all programs and puts itself into a low powered mode).
This means that there is no separate stand by / sleep / hibernate modes as in e.g. Windows but just one: sleep. Also with this method when the battery runs out or the power is lost - when you restart the computer it will find the hibernate file and restarts with all your programs running as it was left. Is not this cool?
Of course some of you might want to save on the battery - so they should always just go to hibernate mode and leave the low power stand by mode out. You can do that only from the command line - Terminal application as it should not be changed by average users. These are the commands:
sudo pmset -a hibernatemode 1 (it affects all modes: battery and ups and ac)
sudo pmset -b hibernatemode 1 (only battery mode affected)
to reset enter 3 instead of 1. It will ask for your password. And there’s no need to restart.
If you do have secure virtual memory enabled (by default it is not) use 5 instead of 1. That’s all as far as I am aware.
Again. I think this surpasses windows xp or vista’s operation where you are presented with lots of options. On the Mac it just works. And just please tell me about it. I was a power windows user for too long. Enough is enough.
October 25th, 2007 at 09:15
hi,
this is by far the best explanation for this standby/hypernate stuff. You have one small typo “… to reset enter 3 instead of 3.” should be …enter 3 instead of 1.
October 27th, 2007 at 11:28
glad you liked it. i corrected the typo, thanks for pointing that out.
January 13th, 2008 at 13:36
Hello,
Firewire port dead on my macbook, cannot put the mac in sleep mode. Faulty logic board says Apple maintenance, change it, or buy a new mac !
No sleep mode means hard diskk spinning endlessly.
To stop the hard disk spinning only one way : complete shutdown.Not handy for a laptop.
Is there a way, by using terminal, to tell the mac, in spite of this faulty firewire : go to sleep, stop hard disk, and be ready to wake up when required ?
January 16th, 2008 at 19:54
Yes, there should be a way to do that manually.
You need to open up Terminal.app and type:
sudo shutdown -s 0
To learn other options and parameters type “man shutdown” in Termanial.
That’s all. Simple enough?
January 17th, 2008 at 20:22
No success with sudo shutdown -s 0.
I was more successful whith halt.
Still looking for words to be typed in terminal to put the hard disk to sleep, as the sleep command and the “put the hard disk to sleep” in preferences give no result on this macbook. Probably linked with dead firewire port and faulty logic board.
An option to stop the hard disk spinning !
December 28th, 2008 at 00:03
hi admin adn people nice forum indeed. how’s life?
April 19th, 2009 at 22:30
Thx a lot for this description!
July 8th, 2009 at 18:58
hey this is a awesome n to the point explaination thanx to u all.
January 19th, 2010 at 04:44
‘Just works’ does not include anything that requires use of a command line.
January 28th, 2010 at 19:22
@Chris: The “Just works” statement was about the default handling of the various sleep/hibernate modes performed by OS X. Use of the command line is just for people that want to mess with it for specific needs or wants. For the vast majority of users, it “just works”.
March 22nd, 2010 at 02:27
…Ahhhm. I didn’t read all the comments here - so maybe someone else already pointed this out:
In Windows, _I_ can decide in my GUI which PowerSaving Mode _I_ want to use (and suits my current situation better). And I can do this without hacking *x-commands to a console window (btw. undocumented commands from the view of the OS X GUI). So the outcome of any objective comparison between Windows and OS X regarding PowerSaving must be that OS X is inferior and does no way surpass Windows. Every other result is bare window dressing.
_I_ would very like beeing able to choose from GUI between StandBy (sudo pmset -a hibernatemode 3) and Hibernate (sudo pmset -a hibernatemode 1) - when I’m sleeping, my Mac should consume NO energy at all, so hibernate. It’s okay if it takes it 10s more to wake up in the morning. During the day I’d prefer StandBy for the shorter wakeups.
I am no Windows Phanboy or so, I am a Windows, Linux and OS X Administrator (currently working for IBM Germany as Server Administrator for ’bout 400 mixed OS servers).
But there is one (1) rule: if you compare, compare fair. And if you are fair, Windows will win the PowerSaving comparison. Fullstop.
June 29th, 2010 at 23:29
bullsh**t. First of, u should know first os who has got a gui was…not a windows. Next u don’t intimidate me when talking about your experience as u don’t seem to be that professional. and professionals, I ‘ve knew all along my life. They ‘ren’t better (so to say) than the 13 years old geek all day long discovering new stuff and learning more than all your f***ing sh**ty life.
Next time, learn how to be a gentleman or die dumb.
Rest In Peace.
July 29th, 2010 at 23:47
@am_not_Chris:
DiaF, please. You talk like a moron. Chris is absolutely correct in everything he said. Anyone saying otherwise is an Apple fanboy and clearly doesn’t know the difference between Sleep and Hibernate, and where they should be used. Steve Jobs included.
The fact that Apple omitted this option from their OS is an inconvenience and nothing more. Having less buttons is not always better, especially in a case like this when it involves whether the damn machine actually turns off or not.
If OSX “just works”, why the shit am I in the terminal typing sudo commands just to hibernate? Jesus, fanboys are irritating. Regardless, thanks for the article. Was very helpful.
August 19th, 2010 at 10:16
if i remember correctly there’s an option of hybrid sleep in windows 7 as well where a hibernate file is saved before going to sleep, works pretty much in the same way…
compared to terminal power options in windows r simpler