Differences between revisions 1 and 24 (spanning 23 versions)
Revision 1 as of 2009-04-08 13:48:36
Size: 1369
Comment:
Revision 24 as of 2009-04-14 20:10:14
Size: 2523
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
How-to '''Translations :-''' [[ http://wiki.debian.org/de/Ruhezustand | Deutsch ]]
Line 3: Line 3:
= How to use hibernation without a swap partition. =
Line 4: Line 5:
{{{
dd if=/dev/zero of=/swap bs=1024k count=256
Line 5: Line 8:
dd if=/dev/zero of=/swap bs=1024k count=256mkswap /swap mkswap /swap
}}}
"256" refers to the size in MBs. Set this for at least half the size of your RAM.
Line 7: Line 12:
256MB for the 512MB eeePC.Add this to /etc/fstab: 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 uswsusp which is an alternate suspend method for the linux kernel that can use a swap file instead of a swap partition and also supports features like compression and encryption.
Line 9: Line 30:
/swap swap swap defaults 0 0 Install it:
{{{
aptitude install uswsusp
}}}
You might have to add yourself to the powerdev group.
Line 11: Line 36:
Then, tell the kernel to not use the swap file for swapping: Typically a uswsusp.conf file looks like this:
{{{
# /etc/uswsusp.conf(8) -- Configuration file for s2disk/s2both
Line 13: Line 40:
sysctl -w vm.swappiness=1 resume device = /dev/sda1
Line 15: Line 42:
Modify the last line of /etc/sysctl.conf so it sticks: compress = y
Line 17: Line 44:
vm.swappiness=1 early writeout = y
Line 19: Line 46:
You can now activate the swap file: image size = 238941634
Line 21: Line 48:
swapon /swap RSA key file = /etc/uswsusp.key
Line 23: Line 50:
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: shutdown method = platform
Line 25: Line 52:
aptitude install uswsusp resume offset = 8288
}}}
The "resume offset = 8288" is where the swapfile actually is, and "resume device" must be the partition and not the swap file.
Line 27: Line 56:
(don't forget to enable memory compression).To test it: 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.
Line 29: Line 66:
s2disk
Line 31: Line 67:
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: Caveats. -- The console is apparently broken. More on this later.
Line 33: Line 69:
/sbin/s2disk To-Do -- Create the swapfile at the moment of hibernation - and delete (optionally) after resuming.
Line 35: Line 71:
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.
Caveats
For more on Partitioning, Swap and Hibernation - see -
Line 38: Line 73:
The console is apparently completely broken. [[http://wiki.debian.org/DebianEeePC/HowTo/Install#Partitioningandswap]]

[[http://wiki.debian.org/Hibernation]]

[[http://wiki.debian.org/DebianEeePC/HowTo/Configure#Hibernate.28suspend-to-disk.29]]

Translations :- Deutsch

How to use hibernation without a swap partition.

First, create a swap file:

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

mkswap /swap 

"256" refers to the size in MBs. Set this for at least half the size of your RAM.

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 uswsusp which is an alternate suspend method for the linux kernel that can use a swap file instead of a swap partition and also supports features like compression and encryption.

Install it:

aptitude install uswsusp

You might have to add yourself to the powerdev group.

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 where the swapfile actually is, and "resume device" must be the partition and not the swap file.

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.

To-Do -- Create the swapfile at the moment of hibernation - and delete (optionally) after resuming.

For more on Partitioning, Swap and Hibernation - see -

http://wiki.debian.org/DebianEeePC/HowTo/Install#Partitioningandswap

http://wiki.debian.org/Hibernation

http://wiki.debian.org/DebianEeePC/HowTo/Configure#Hibernate.28suspend-to-disk.29