10

I have Debian 6, I have also seen this under Ubuntu (can not remember how I fixed it).

I can hibernate, but when I switch on the system cold boots (it does not restore previous session).


Note suspend works fine. Have looked in /var/log/pm-suspend.log Shows for each suspend suspend block a resume suspend block, but hibernate hibernate' is not followed byresume hibernate` ( I assume that is what is expected.


Installed package hibernate, as was thinking it may be needed, but made no difference.


I just started looking and can't find /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux or /usr/lib/hal I searched for power files (is it all there?:

find /usr/lib -iname "*power*"
/usr/lib/libupower-glib.so.1
/usr/lib/klibc/bin/poweroff
/usr/lib/python2.6/dist-packages/axiom/test/test_powerup.pyc
/usr/lib/python2.6/dist-packages/axiom/test/test_powerup.py
/usr/lib/upower
/usr/lib/upower/upowerd
/usr/lib/libupower-glib.so.1.0.1
/usr/lib/gnome-power-manager
/usr/lib/pymodules/python2.6/OpenGL/raw/GL/ARB/texture_non_power_of_two.pyc
/usr/lib/pymodules/python2.6/OpenGL/raw/GL/ARB/texture_non_power_of_two.py
/usr/lib/pymodules/python2.6/OpenGL/GL/ARB/texture_non_power_of_two.pyc
/usr/lib/pymodules/python2.6/OpenGL/GL/ARB/texture_non_power_of_two.py
/usr/lib/pymodules/python2.6/coherence/upnp/services/servers/switch_power_server.py
/usr/lib/pymodules/python2.6/coherence/upnp/services/servers/switch_power_server.pyc
/usr/lib/pymodules/python2.6/coherence/upnp/services/clients/switch_power_client.pyc
/usr/lib/pymodules/python2.6/coherence/upnp/services/clients/test/test_switch_power_client.py
/usr/lib/pymodules/python2.6/coherence/upnp/services/clients/test/test_switch_power_client.pyc
/usr/lib/pymodules/python2.6/coherence/upnp/services/clients/switch_power_client.py
/usr/lib/pymodules/python2.6/coherence/upnp/core/xml-service-descriptions/SwitchPower1.xml
/usr/lib/pm-utils/power.d
/usr/lib/pm-utils/power.d/sched-powersave
/usr/lib/pm-utils/sleep.d/00powersave
/usr/lib/rhythmbox/plugins/power-manager
/usr/lib/rhythmbox/plugins/power-manager/libpower-manager.so
/usr/lib/rhythmbox/plugins/power-manager/power-manager.rb-plugin
3
  • Do you have a swap partition or just a swap file? Hibernating to a swap file is supported in theory but sometimes requires some hand-holding. Swap partitions should work out of the box (at least they do on Debian 5). Commented Mar 8, 2011 at 18:32
  • it is a partition Commented Mar 8, 2011 at 19:04
  • This issue has now fixed it self, there is nothing in synaptics history to say that I installed something to fix it. It may have been an update, are these in the same history log? BUT Redetection of my 'option' modem is now slower. Commented Mar 29, 2011 at 14:17

5 Answers 5

11

I've just had to deal with this on a laptop running Debian Testing (Jessie/Sid).

Possibly relevant: swap partition on an LVM volume (non-encrypted) at /dev/vg1/swap.

To make the system resume after hibernation, I had to edit /etc/default/grub and change

GRUB_CMDLINE_LINUX=""

to

GRUB_CMDLINE_LINUX="resume=/dev/mapper/vg1-swap"

and then run update-grub.

If you'd rather the kernel didn't check for resume images when you choose a recovery option from the GRUB menu, you'd want to modify GRUB_CMDLINE_LINUX_DEFAULT instead of GRUB_CMDLINE_LINUX.

I would have expected update-grub to write any necessary resume= parameters into /boot/grub/grub.cfg on its own, without my needing to be this explicit about it.

However, the only mention of resume= inside the script fragments in /etc/grub.d is in a piece that has something to do with OSX support. Not sure what's going on there.

1
  • Worked on Debian 11 Bullseye with a small change. Instead of resume=/dev/mapper/vg1-swap, I wrote resume=UUID=1603aad4-2435-4da2-9520-c21b70fa9be3 where 1603aad4-2435-4da2-9520-c21b70fa9be3 is the UUID of my swap partition. To get the UUID, I ran ls /dev/disk/by-uuid -la and took the UUID against the ../../sda3 entry (my swap partition)
    – Sufian
    Commented Aug 30, 2021 at 2:29
4

This is a common issue for hibernate and suspend in Ubuntu / Debian.

install uswsusp

sudo apt-get install uswsusp

then try the following for suspend and hibernate respectively,

sudo s2ram

sudo s2disk

if it works, then you can make it permanent, back up the following,

sudo cp /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux.bak

sudo cp /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux.bak

and edit the following,

/usr/lib/hal/scripts/linux/hal-system-power-suspend-linux

#!/bin/sh
/sbin/s2ram –force

/usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux

#!/bin/sh
/sbin/s2disk
5
  • I am thinking that this is an alternative suspend/hibernate subsystem. I will try if can't fix the current one. Commented Mar 8, 2011 at 13:25
  • right, let us know the result. you need to install the proper drivers for it to work. this is just an alternative.
    – setzamora
    Commented Mar 8, 2011 at 14:03
  • can't find /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux see question Commented Mar 9, 2011 at 10:49
  • I have discovered that the uswsusp package is missing from debian squeeze. I could get it from testing or unstable repository, but have to be careful about not pulling in other dependencies. I would like to know if it will fix it. Is uswsusp needed for hibernate. Or should pm-utils be enough. (suspend it ram is working fine.) Commented Mar 18, 2011 at 18:04
  • Amazing, working for me: sudo s2ram Commented Nov 5, 2020 at 15:34
1

If you have change your hard disk or the partition table, then your computer will save a session, but it won't be able to resume it upon power up, acting as if it was rebooted rather than hibernated.

In this case, you have to inform initramfs-tools about the correct partition uuid. First of all, take note of the id of your swap partition with

$ ls /dev/disk/by-uuid -la

Then, edit the file /etc/initramfs-tools/conf.d/resume accordingly.

Finally update initramfs with

# update-initramfs -u

It it still doesn't work, try to specify the restore partition to Grub too. However, it should not be necessary.

Edit the file /etc/default/grub specifying the UUID of your swap partition:

GRUB_CMDLINE_LINUX="resume=UUID=6098d082-4654-4840-8937-7337d14b2c5d other-option=value"

or simply use the device

GRUB_CMDLINE_LINUX="resume=/dev/sda1 other-option=value"

Don't forget to update Grub.

# update-grub

Reboot, and try to hibernate:

# pm-hibernate

1
# update-initramfs -u

This was the missing piece in my similar case. When resume from a successful hibernate started failing, after changing the swap partition. A lot of advice suggested the grub command-line fix (like mentioned in earlier answer here).

However on my system (Ubuntu 14.04) hibernate used to work OK, without the resume parameter in grub, before the change to the swap partition. So I realized there must be some other way the resume is handled.

The sequence to enable the hibernate/resume after changes to swap partition change (after a new UUID has been assigned to the swap partition device, per blkid or ls /dev/disk/by-uuid -la):

  1. Edit /etc/fstab to change to the swap's new UUID
  2. Edit /etc/initramfs-tools/conf.d/resume to reflect the new swap's UUID
  3. Run update-initramfs -u to rebuild the /boot/initrd.img*
  4. Reboot

Thanks to @Demis Palma!

1
  • Thanks. Looks promising (I can't test now, I will the next time things go wrong). Commented Nov 18, 2019 at 18:38
0

For suse the solution can be found here:

https://www.suse.com/support/kb/doc/?id=000020287

1
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – AdminBee
    Commented Jul 13, 2023 at 11:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .