Suspend/Hibernate an Ubuntu Lucid Desktop

Out of the box hibernation and suspend do not work on any of my systems, I want my desktop to suspend when I leave the room to reduce the heat in my study, particularly during the summer. To make suspend/hibernate work, install a tool called “uswsusp”.

sudo apt-get install uswsusp

To check if the suspend function works using uswsusp:

sudo s2ram

For hibernation use:

sudo s2disk

Assuming the above commands work, they can be used to replace the old non-working commands that come with Lucid. Just to be safe, before editing the system files, back up the files in case something goes completely wrong.

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

Next replace the old suspend commands with the new commands in hal-system-power-suspend-linux

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

and replace existing code with the following:

#!/bin/sh/usr/sbin/s2ram -force

Repeat for the hibernate file hal-system-power-hibernate-linux

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

Once again, replace existing code with the following:

#!/bin/sh/usr/sbin/s2disk

A final warning: If for whatever reason you decide to move the location of your linux swap partition, say from sdxy to sdqz then you will need to purge (completely remove including configuration files) uswsusp. Otherwise you will get a boot error something like:

    Resume: Resume cannot stat….

To address this:

sudo apt-get purge uswsusp
sudo apt-get clean
sudo apt-get install uswsusp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: