Elementary OS Freya has the Hibernate mode enabled by default settings, but you can only assign the power button in settings to do the action when pressed. There is no hibernate option in the Power menu that pops-up when you click on power icon on top right corner of the elementary desktop.
Before doing anything, you may want to first check if your elementary has the hibernate option enabled. Go to ‘System Settings’ and click ‘Power’ icon. You should see Hibernate option there.
SWAP Partition and Hibernate
Next, make sure Hibernate is compatible with you PC. Launch terminal and run the following command:
After your PC turns off, switch it back on and check if your open applications re-open? If hibernate doesn’t work, check if your swap partition is at least as large as your available RAM. Linux recommends twice as size of RAM for its SWAP partition. For example if your PC has 8 GB of RAM, then you should be having at least 16 GB of SWAP partition. To check the SWAP partition size, open Terminal and type the fdisk command.
sudo fdisk -l
Enable Hibernate to the Power Wingpanel
Open Terminal and type the following commands one-at-a-time:
sudo touch /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla sudo scratch-text-editor /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Add the following to the text editor that opens after the above commands:
[Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes
[Re-enable hibernate by default for login1] Identity=unix-user:* Action=org.freedesktop.login1.hibernate ResultActive=yes
[Re-enable hibernate for multiple users by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate-multiple-sessions ResultActive=yes
Log off and login again and you will see the Hibernate option in the Power drop down menu.