Sunday, November 9, 2014

Linux Mint goes into hibernate but boots back fresh (with no hibernate saved info)

So, it does look like it goes into hibernate, but when it comes back after boot, it simply looks like a fresh new boot, nothing left from the previous session.

So, I followed these steps (besides trying the stuff that didn't work below).
In my case I could check the log and see the difference between a successful suspend and a failed hibernate. I used: more /var/log/pm-suspend.log

You can see that the part of the log corresponding to the suspend finishes with:
...
Running hook /usr/lib/pm-utils/sleep.d/99video suspend suspend:
kernel.acpi_video_flags = 0
/usr/lib/pm-utils/sleep.d/99video suspend suspend: success.

Running hook /etc/pm/sleep.d/novatel_3g_suspend suspend suspend:
/etc/pm/sleep.d/novatel_3g_suspend suspend suspend: success.

Sat Nov  8 18:32:07 CST 2014: performing suspend


And immediately after, the next lines are:
Sat Nov  8 18:49:03 CST 2014: Awake.
Sat Nov  8 18:49:03 CST 2014: Running hooks for resume

Running hook /etc/pm/sleep.d/novatel_3g_suspend resume suspend:
/etc/pm/sleep.d/novatel_3g_suspend resume suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/99video resume suspend:
/usr/lib/pm-utils/sleep.d/99video resume suspend: success.

Running hook...


I.e., one can see how the machine saves stuff and goes into suspend at 18:32, and at 18:49 was awaken and starts restoring the stuff on the reverse order than it saved.

Scrolling up on that log, we can see a previous hibernate attempt we had performed right before this suspend, where it did the same thing and finished on the same peripherals...
Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.

Running hook /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate:
/etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate: success.

Sat Nov  8 18:01:55 CST 2014: performing hibernate


... but never came back. The next line in the peripherals was the suspend sequence described before. At this moment, after being upset with Linux because of hibernate not working, I have to say that at least, this log is kick-ass... I guess that's one reason to like Linux :)

So, moving on...

The step by step debugging post would be blaming the shut down sequence because the hibernate saving didn't finish with something like:
"Sun Jul 24 13:15:14 HST 2011: Finished."

Not sure that is the case, as the suspend sequence doesn't really have that... MMMMmmmm...  So, I am going to move on into the restoring part (his 3rd case).

The basic problem looks like GRUB (the boot loader) doesn't know where to look for the swap partition. So, I just followed the steps on the the same link. All what I needed to do was:

sudo gedit /etc/default/grub

Look for the line that starts with.  GRUB_CMDLINE_LINUX
Add the following option in blue.

GRUB_CMDLINE_LINUX=”resume=UUID=Your-SWAP-UUID other-option=value”

where in my case, my Your-swap-UUID was b71d9df1-1b6a-4320-9046-0ec62a49cea0

To find out what number is that you can do cat /etc/fstab

"You may or may nor have other options. Be careful that you type in the correct path or UUID for the drive here. If you don’t then when you try to resume you will have to boot in safe mode to fix the drive name and re-run the update-grub script."

Then save the file and update grub with the following command:

sudo update-grub

Just one last step (which in my case, by chance I had done when following this partial solution which now I updated :) ) Note: when I did it, I was not 100% sure I had done it properly cause I was getting an error...

sudo gedit /etc/initramfs-tools/conf.d/resume

And add the line:

resume=UUID=Your-SWAP-UUID

Again, your number. Note: notice that the link actually had hardwired that number (obviously just forgot...).

Then run this command to update:

sudo update-initramfs -u  

Now hibernate your computer and cross your fingers!

In my case it did work (otherwise why I would post this!?! :) ) and now I can see the correct log file where sure enough "Finished" was not there...

Cheers!

PS.: Other things that didn't work for me but may help you:
  1. This to see what the PC monitors during hibernate
  2. Or this, adding some fancy code... I think this portion is similar to one of the steps in the link

No comments:

Post a Comment