Differences between revisions 30 and 32 (spanning 2 versions)
Revision 30 as of 2011-07-06 19:17:36
Size: 2811
Editor: ?Сергій Загорія
Comment: replacing dd with fallocate: it's faster
Revision 32 as of 2011-09-06 15:22:33
Size: 2790
Editor: LluisRubies
Comment:
Deletions are marked like this. Additions are marked like this.
Line 64: Line 64:
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: 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 will have to edit it so it looks like this:
Line 77: Line 77:
 * [[DebianEeePC/HowTo/Install#Partitioningandswap]]
 * [[DebianEeePC/HowTo/Configure#Hibernate.28suspend-to-disk.29]]
 * [[DebianEeePC/HowTo/Install]]
 * [[DebianEeePC/HowTo/Configure#Hibernate_.28suspend-to-disk.29]]

Translations : Deutsch

How to use hibernation without a swap partition.

First, create a swap file:

fallocate -l 256m /swap

mkswap /swap 

"256" refers to the size in MBs ('m' after it). 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 will 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 -