10

In my Ubuntu 12.04, the hibernation option was working well and fine. However, I installed Debian on another partition recently and when I again tried to boot to Ubuntu, I got a message on the boot splash screen saying :

The disk drive for / is not ready yet or not present. Continue to wait; or press s to skip mounting or M for manual recovery.

After logging into Ubuntu, I find that my hibernation option has gone missing.

Is there anyway to recover the hibernation option?

EDIT: I solved the disk drive problem and I got the hibernation option back. When I did "sudo pm-hibernate", my system went to hibernation. However, when powering on again, it booted up normally and thus there was no effect of hibernation.

How can this be rectified?

EDIT1: System - Lenovo ideapad s10-2.

enter image description here

EDIT2: /etc/fstab

enter image description here

EDIT3: Screenshot of my hard disk.

enter image description here

harisibrahimkv
  • 7,256
  • 11
  • 44
  • 71

5 Answers5

12

I assume you have installed Debian in a way that it uses it's own separate swap partition. If you have not, I would suggest doing so (create another swap partition and change the /etc/fstab files accordingly), because too different operating systems writing to the same swap partition may discard hibernation data stored on the partition by the other OS.

Then you have to ensure that the OS you want to use hibernation on (usually both), writes to the correct partition. This is configured in the /etc/initramfs-tools/conf.d/resume file. You have to put the UUID of the correct swap partition in there (use sudo blkid /dev/$device_name to get the UUID). Finally you need to update the initial ramdisk:

sudo update-initramfs -u -k all

That should fix it.

LiveWireBT
  • 28,763
  • 1
    This worked perfectly fine. Thank you, I got my hibernation back. :) – harisibrahimkv Sep 19 '12 at 08:55
  • 1
    I, too had problems resuming from hibernate. After having somehow changed the UUID of my swap partition, my system would not resume no matter what I seemed to do. Fixing my /etc/initramfs-tools/conf.d/resume, by copy-pasting the UUID from sudo blkid seems to have fixed the problem. – TSJNachos117 Jan 21 '14 at 04:35
2

Unfortunately, hibernate doesn't work in many cases, which can cause you to lose data if you expect your documents and applications to re-open when you switch your computer back on. Therefore, hibernate is disabled by default.

Test if hibernate works

Note : Always save your work before hibernating
You should save all of your work before hibernating the computer, just in case something goes wrong and your open applications and documents cannot be recovered when you switch on the computer again.

You can use the command line to test if hibernate works on your computer.

  1. Open the Terminal by pressing Ctrl+Alt+T or by searching for terminal in the Dash.

  2. Type sudo pm-hibernate into the terminal and press Enter.
    Enter your password when prompted.

  3. After you computer turns off, switch it back on. Did your open applications re-open?

If hibernate doesn't work, check if your swap partition is at least as large as your available RAM.

Enable hibernate

If the hibernate test works, you can continue to use the sudo pm-hibernate command when you want to hibernate.

You can also enable the hibernate option in the menus. To do that, use your favorite text editor to create /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla. Add the following to the file and save:

[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; org.freedesktop.login1.hibernate-multiple-sessions ResultActive=yes

Restart and hibernation is back!

Or run killall unity-panel-service to just reset the menu.

Some users will then need to run sudo update-grub to get the hibernate option to be available in the power menu. Some users may also have to at least log out then log in to get it to appear in the (upper right) power menu.

Source : Ubuntu Docs - Power Hibernate

Source : Ubuntu Wiki - Debugging Kernel Hibernate

0

Try to add nobootwait option to the /etc/fstab, something like this:

/dev/sda1 / ext4 rw,nobootwait 0 1

Frantique
  • 8,493
0

When going into hibernate, a full image of you RAM is copied to swap. So most of the time people have problems with hibernation not working, their swap is too small.

You need at least as much swap as you have RAM. If you have a lot of RAM, set swappiness=0. So if you have 8GB of RAM, use 8.5 or 9GB of swap. If you have 4GB of RAM, 6GB of swap is a good number.

mniess
  • 10,546
0

As far as I know Linux including Ubuntu should have swap space 2x of ram installed.

Some how my custom build computer configuration is not able to use hibernate tho I have more then enough swap space. image

If you think your swap is slowing you down you can use this script I found on the internet. It cleans swap.

#!/bin/bash

free_data="$(free)"
mem_data="$(echo "$free_data" | grep 'Mem:')"
free_mem="$(echo "$mem_data" | awk '{print $4}')"
buffers="$(echo "$mem_data" | awk '{print $6}')"
cache="$(echo "$mem_data" | awk '{print $7}')"
total_free=$((free_mem + buffers + cache))
used_swap="$(echo "$free_data" | grep 'Swap:' | awk '{print $3}')"

echo -e "Free memory:\t$total_free kB ($((total_free / 1024)) MB)\nUsed swap:\t$used_swap kB ($((used_swap / 1024)) MB)"
if [[ $used_swap -eq 0 ]]; then
    echo "Congratulations! No swap is in use."
elif [[ $used_swap -lt $total_free ]]; then
    echo "Freeing swap..."
    swapoff -a
    swapon -a
else
    echo "Not enough free memory. Exiting."
    exit 1
fi
nkvnkv
  • 785
  • 3
  • 8
  • 16