28 December 2009 View Comments

Fix Suspend and Hibernate on 6930p


I have installed Ubuntu 9.10 on my HP EliteBook 6930p Intel 64bits but find it can’t go into hibernate. These are steps I tool to get it working. Because if there is no swap file, linux can’t go into hibernation, for that reason, I firstly checked if the system swap files were mounted properly. This can be done using the free command.

Check the Swap File


$ free
Swap: 4883720 168640 4715080
total used free shared buffers cached
Mem: 3061168 801112 2260056 0 28616 174868
-/+ buffers/cache: 597628 2463540

if you don’t see the Swap or it is 0, then you will need to add an entry in the fstab file for a swap space. Post back if you need help with that.

There two files controls the hibernation and suspend, and they are in the following directory:

$ ls /usr/lib/hal/scripts/linux
hal-dockstation-undock-linux hal-system-lcd-set-brightness-linux hal-system-power-suspend-linux~
hal-luks-remove-linux hal-system-power-hibernate-linux hal-system-power-suspend-linux.bak
hal-luks-setup-linux hal-system-power-reboot-linux hal-system-wol-enabled-linux
hal-luks-teardown-linux hal-system-power-set-power-save-linux hal-system-wol-enable-linux
hal-system-killswitch-get-power-linux hal-system-power-shutdown-linux hal-system-wol-linux
hal-system-killswitch-set-power-linux hal-system-power-suspend-hybrid-linux hal-system-wol-supported-linux
hal-system-lcd-get-brightness-linux hal-system-power-suspend-linux

Backup Important Files

They are hal-system-power-hibernate-linux and hal-system-power-suspend-linux. I made backup for each of them just in case.

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

An example of the file contends:

$ head -5 hal-system-power-hibernate-linux
#!/bin/sh
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >& 2
echo No hibernate script found >& 2

Use s2disk and s2ram Commands

I basically deleted the file contents and replaced the hibernation file with /usr/sbin/s2disk --force


$ cat hal-system-power-hibernate-linux
#!/bin/sh
/usr/sbin/s2disk --force

and the suspend file as:

$ cat hal-system-power-suspend-linux
#!/bin/sh
/usr/sbin/s2ram --force

If you do man s2disk and you will find: s2disk – program to suspend to disk (hibernate)

Reference

blog comments powered by Disqus