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.


10 Responses to “Mac OS X Hibernate / Sleep mode”

  • schwiddy Says:

    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.

  • kcs Says:

    glad you liked it. i corrected the typo, thanks for pointing that out.

  • Ghislain Says:

    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 ?

  • kcs Says:

    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? :)

  • Ghislain Says:

    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 !

  • AremyownerVott Says:

    hi admin adn people nice forum indeed. how’s life?

  • John Says:

    Thx a lot for this description!

  • sandy Says:

    hey this is a awesome n to the point explaination thanx to u all.

  • Chris Says:

    ‘Just works’ does not include anything that requires use of a command line.

  • Michael Says:

    @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”.

Leave a Reply