Differences between revisions 5 and 6
Revision 5 as of 2009-04-08 14:06:16
Size: 1790
Comment:
Revision 6 as of 2009-04-08 14:17:15
Size: 1968
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
How-to How-to use hibernation on the eee without having to create a swap partition.
Line 6: Line 6:
Line 12: Line 13:
Then, tell the kernel to not use the swap file for swapping: Now stop the kernel from using the swap file for swapping:
Line 16: Line 17:
Modify the last line of /etc/sysctl.conf so it sticks: Edit the last line of /etc/sysctl.conf so it sticks:
Line 20: Line 21:
You can now activate the swap file: Activate the swap file:
Line 24: Line 25:
And now the magic ingredient: µswsusp, an alternative suspend method for the linux kernel that can use swap file instead of swap partition and also support other neat features like compression and encryption.Install it: Now use µswsusp which is an alternate suspend method for the linux kernel that can use a swap file instead of a swap partition and also support other neat features like compression and encryption.

Install it:
Line 54: Line 57:
It will write the content of the RAM to the swap file and shutdown the eee.Press the power button on the eee to wake it up.To enable this method as the default system for hibernation, edit the following file: /usr/lib/hal/linux/scripts/hal-system-power-hibernateThere is a bug in this script, it will look for s2disk in the wrong place, you'll have to edit it so it looks like this: This will write the content of the RAM to the swap file and shutdown the eee. Press the power button on the eee to wake it up. To enable this method as the default system for hibernation, edit /usr/lib/hal/linux/scripts/hal-system-power-hibernate . There is a bug in this script and it will look for s2disk in the wrong place, you willll have to edit it so it looks like this:
Line 58: Line 61:
As this script is part of the HAL package, it means that it WILL break if this package is updated, you'll have to reedit the above file if hibernate doesn't work after an update. This script is in the HAL package, which means it will break if HAL is updated. If hibernate doesn't work after an update, you will have to re-edit /usr/lib/hal/linux/scripts/hal-system-power-hibernate . A good idea would be to make a backup of the file for quick re-insertion after an update breakage.
Line 61: Line 64:
Caveats.
The console is apparently completely broken.
Caveats. -- The console is apparently broken. More on this later.

How-to use hibernation on the eee without having to create a swap partition.

First, create a swap file:

dd if=/dev/zero of=/swap bs=1024k count=256

mkswap /swap

256MB for the 512MB eeePC.Add this to /etc/fstab:

/swap swap swap defaults 0 0

Now stop the kernel from using the swap file for swapping:

sysctl -w vm.swappiness=1

Edit the last line of /etc/sysctl.conf so it sticks:

vm.swappiness=1

Activate the swap file:

swapon /swap

Now use µswsusp which is an alternate suspend method for the linux kernel that can use a swap file instead of a swap partition and also support other neat features like compression and encryption.

Install it:

aptitude install uswsusp

Don't forget to add yourself to the powerdev group and enable memory compression.

Typically a uswsusp.conf file looks like this:

# /etc/uswsusp.conf(8) -- Configuration file for s2disk/s2both

resume device = /dev/sda1

compress = y

early writeout = y

image size = 238941634

RSA key file = /etc/uswsusp.key

shutdown method = platform

resume offset = 8288

The "resume offset = 8288" is here to tell where the swapfile is located.

To test it:

s2disk

This will write the content of the RAM to the swap file and shutdown the eee. Press the power button on the eee to wake it up. To enable this method as the default system for hibernation, edit /usr/lib/hal/linux/scripts/hal-system-power-hibernate . There is a bug in this script and it will look for s2disk in the wrong place, you willll have to edit it so it looks like this:

/sbin/s2disk

This script is in the HAL package, which means it will break if HAL is updated. If hibernate doesn't work after an update, you will have to re-edit /usr/lib/hal/linux/scripts/hal-system-power-hibernate . A good idea would be to make a backup of the file for quick re-insertion after an update breakage.

Caveats. -- The console is apparently broken. More on this later.