Hibernate – Cannot Hibernate Twice Issue

hibernate

I am running Ubuntu 13.10, and I manage to suspend to RAM without any incidents. Suspending to disk (hibernate), however, does not work the second time I do it (after a reboot).

I tried to hibernate with pm-hibernate and also with uswusp.

The first time after a re-boot it goes fine, but if I try to hibernate again, it will hung with the message s2disk snapshooting system and I'll have to re-boot.

My swap partition is bigger than my RAM.

My /etc/default/grub:

GRUB_DEFAULT="5"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="resume=UUID=6a6e6406-4022-4620-bb36-fbf29f5c1cdf"
GRUB_SAVEDEFAULT="false"

I run update-grub after changing the CMDLINE_LINUX parameter.

My /etc/initramfs-tools/conf.d/resume:

RESUME=UUID=6a6e6406-4022-4620-bb36-fbf29f5c1cdf

Updated it after changing it with:

sudo update-initramfs -u

I tried 're-setting' my swap with:

sudo swapoff -a && sudo swapon -U 6a6e6406-4022-4620-bb36-fbf29f5c1cdf

but it didn't change anything.

Output of free -m:

               total       used       free     shared    buffers     cached 
 Mem:          1865         644       1220          0        111        328
 -/+ buffers/cache:         205       1659 
 Swap:         2044           0       2044

Output of name -a:

Linux QuoraF 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Is there any way to maybe re-set what's wrong after the first hibernation? I imagine that the system creates something somewhere, and this something blocks subsequent hibernations.

Best Answer

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.

Related Question