One of the most annoying MabBook Pro features that I encountered was the absence of clickable hibernation mode settings. How do you force the damn thing to write its state to the disk and shut itself down, so the battery is not being drained?
The default behavior after closing the lid is some kind of sleep mode, which according to apple is awesome. The only problem being that after a night spent in this mode the battery is empty and you will have to reach for the charger in order to wake your laptop up...
pmset is a command line tool that apple has bundled in their OS X operating system. Its purpose is to display and/or modify the power management settings. Here is what you can do with it regarding hibernation. Start Terminal - you can find it in the folder Applications/Utilities (I have a link on my desktop.)
[ man pmset ] will give a you a detailed description all of its capabilities.
[ pmset -g custom ] this command will display the current settings for all power sources.
I would suggest you run [ pmset -g custom > pmset.default ] to save the default settings to a file named 'pmset.defaut'. You may consult with this file in the future in order to restore your settings after disastrous modifications.
Here is what my current pmset.default file looks like:
Battery Power: lidwake 1 panicrestart 157680000 standbydelay 4200 standby 0 ttyskeepawake 1 hibernatemode 25 hibernatefile /var/vm/sleepimage displaysleep 3 sleep 10 acwake 0 halfdim 1 sms 1 lessbright 1 disksleep 10 | AC Power: lidwake 1 panicrestart 157680000 standbydelay 4200 standby 0 ttyskeepawake 1 hibernatemode 3 hibernatefile /var/vm/sleepimage womp 1 displaysleep 15 networkoversleep 0 sleep 0 acwake 0 halfdim 1 sms 1 disksleep 10 |
As a factory default, the hibernatemode setting is 3 for both battery and ac power. The argument is a bit-field, which is 0000:0011 in binary format - bits 0 and 1 are both set. In this mode the laptop enters sleep mode with the state of the machine is saved in the memory for fast wake up times. However, this mode consumes too much power and is not desirable when running on battery. When ac power is connected I do not see any problem with entering this sleep mode, so I kept the default setting (3) as seen above.
The magic is in setting the battery power hibernatemode to 25, or binary 0001:1001 - bits 0, 3, and 4 are all set. Here is what you should do:
[ sudo pmset -b hibernatemode 25 ] - this command will ask you for the root password and will set the proper mode for battery power only, hence the -b switch.
Apple does not suggest setting the hibernatemode to a value other than 0, 3, or 25, so experiment at your own risk. As for me, 25 does all that is expected from real hibernation - saves everything to the disk and shuts the machine down. Waking up takes no more than 6 seconds on my MacBook Pro and the battery has all its juice left.
The magic is in setting the battery power hibernatemode to 25, or binary 0001:1001 - bits 0, 3, and 4 are all set. Here is what you should do:
[ sudo pmset -b hibernatemode 25 ] - this command will ask you for the root password and will set the proper mode for battery power only, hence the -b switch.
Apple does not suggest setting the hibernatemode to a value other than 0, 3, or 25, so experiment at your own risk. As for me, 25 does all that is expected from real hibernation - saves everything to the disk and shuts the machine down. Waking up takes no more than 6 seconds on my MacBook Pro and the battery has all its juice left.