How to have my MacBook Pro safely hibernate when out of juice?

My all new MacBook Pro was on the battery, and warned me that the battery was almost finished. I left the Mac take care of himself. Later, I plugged the Mac and I pressed the button Power. Hearing the startup sound made me frosty. The Mac had shut down !

When my venerable old MacBook Pro runs out of battery, he goes safely into hibernation, and, when later I plug him and press the button Power, I have the white bars advancing on the screen and everything I had comes back to life ! This is very nice. How to have my new MacBook Pro do the same when he runs out of juice ?

On my new MacBook Pro, I have Mavericks.


Newer versions of OS X support restoring state when you log in. This means that any applications that were open when you lost power, shut down the machine or rebooted would open back up to where they were previously.

Using this mechanism, there is no need to write the 'hibernation state' to the disk, which (a) uses a big lump of hard disk space, (b) takes time and (c) is risky - if there's not enough power to complete writing the data, you lose all of the state.

You can use the following Terminal command to configure this if you prefer:

sudo pmset hibernatemode 25

per the help at man pmset:

hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.

...but please heed the following warning in the help (man pmset):

We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don't use anything other 0, 3, or 25.