Cannot hibernate twice

Found a solution. Running:

sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=2

would clean the cache, and the system will be able to hibernate a second time after a re-boot.

I don't now what or why something was accumulating in memory. It should be a stack system, where new entries drag out entries not needed anymore.

Wilf's tips are still valid for a system using the swap space when running. I am using it only for hibernating That means, I had 2 GB, but were only using 1 GB. Had I a need of 3 GB for example, I wouldn't be able to hibernate my 2GB RAM computer using a 2GB swap partition.


I found a workaround for my machine, Asrock Z97 Fatal1ty, because HIBERNATE_MODE="platform" didn't work but "shutdown" does. Testing in the terminal by typing the following as root

echo shutdown > /sys/power/disk

and then

echo disk > /sys/power/state

performed hibernation and worked as many times as I tried. I tried several guides in attempt to change the default mode from "platform" to "shutdown" and none worked so I added the following line below to

/etc/rc.local

echo shutdown > /sys/power/disk 

and then save the file.

edit: I originally had typed "echo shutdown > /sys/mode/disk" and "echo disk > /sys/mode/state" in my original answer and realized my mistake. I also formatted the code the best i could. sorry for the unusual amounts of edits.

you can enable the hibernate menu option by creating the file:

/var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

and adding this to this empty file:

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

and then logout and back in again and hibernate will be in the logout menu options and it worked every time. I know someone can improve this answer but I figured i'd share what worked for me anyways. Ideally one would find the correct file to edit the default mode for hibernation for pm-utils but like I said I tried and nothing worked, but this did. The only caveat I have encountered was that you now have to press the power button to resume from hibernate because the keyboard would not wake the computer like it did with "platform". Hope this helps someone.