Friday, March 1, 2013

Changing hibernate mode

When you switch close your laptop or just leave it for a long time, it may go to hibernation mode. That usually means your memory space is copied to HDD/SSD for safe-keeping. RAM is also suspended, so it should keep its content, but not for too long.

When you start it again after a long pause, it may take some time to read RAM data from your drive. Some people are always in a hurry, so they may want to change the default settings to keep RAM suspended but not to write/read on the disk.

If you one of these people, please be advised it is not safe to run hibernation with RAM only, because you may run out of battery and memory status will be gone. Said that, this is how to deal with hibernation mode.

To check the current settings, run pmset -g | grep hibernatemode

The output usually 3, if you have a laptop. That means "suspend to disk + RAM (default on laptops)"

If you have a desktop, the default is 0: "suspend to RAM only"

To change from one mode to another, use the following command:

sudo pmset -a hibernatemode <0 or 3>