Difference between revisions of "TuxOnIce"
(→Configuration tips) |
|||
(72 intermediate revisions by 27 users not shown) | |||
Line 1: | Line 1: | ||
− | == | + | {| width="100%" |
− | Software Suspend 2, | + | |style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__ |
+ | |style="vertical-align:top" | | ||
+ | ===TuxOnIce (formerly "Software Suspend 2")=== | ||
+ | TuxOnIce, formerly called as "Software Suspend 2", "suspend2" or "swsusp2", is an implementation of suspend-to-disk functionality in the form of a Linux kernel patch and several userspace utilities. It is an alternative to both the BIOS-driven hibernation feature found on most ThinkPad models, and the [[swsusp]] "software suspend" functionality built into recent Linux kernels. | ||
+ | |} | ||
− | Compared to the alternatives, | + | ==Features== |
− | + | Compared to the alternatives, TuxOnIce has some unique [http://www.tuxonice.net/features features]: | |
− | * Saving the memory image | + | * Saving the memory image into a swap file, a swap partition or a normal file on any filesystem. |
− | * Cancelling a suspend in progress | + | * Cancelling a suspend in progress. |
− | * | + | * Different bugs -- if the alternatives don't work, try this one! |
− | |||
− | Since it is implemented purely in software, | + | It also have the following advantages over [[swsusp]] (these features are also provided, in principle, by the not-yet-stable [[uswsusp]]): |
+ | * The ability to compress the memory image as it is written to disk, thereby reducing suspend and resume times. | ||
+ | * Control over amount of RAM written to disk -- can (optionally) discard cached disk blocks to reduce suspend and resume times. | ||
+ | * Textual and graphical UI (optional). | ||
+ | |||
+ | |||
+ | Since it is implemented purely in software, TuxOnIce is in principle machine-independent and should work on all modern ThinkPad models. However, in some cases problematic drivers need to be unloaded before suspension. This is handled by the <tt>hibernate</tt> script (see below). | ||
+ | |||
+ | ==Availability / Project Homepage== | ||
+ | * [http://www.tuxonice.net/ Project home page] | ||
==Model-specific Status== | ==Model-specific Status== | ||
− | + | ||
+ | {| align="center" cellpadding="2" width="100%" style="border:1px; background:grey;" | ||
+ | ! style="background:#efefef;"| Thinkpad Model | ||
+ | ! style="background:#efefef;"| Type | ||
+ | ! style="background:#efefef;"| Operating System | ||
+ | ! style="background:#efefef;"| Kernel Version | ||
+ | ! style="background:#efefef;"| Suspend2 Version | ||
+ | ! style="background:#efefef;"| Success | ||
+ | ! style="background:#efefef;"| Note | ||
+ | |- style="background: white; color:black;" | ||
+ | |||
+ | | {{240}} | ||
+ | | 2609-21G | ||
+ | | Zenwalk 4.2 | ||
+ | | 2.6.18.6 | ||
+ | | 2.2.9 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{390X}} | ||
+ | | | ||
+ | | VectorLinux 5.8 | ||
+ | | 2.6.23.1 | ||
+ | | svn | ||
+ | ! style ="color:green;"| Yes | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T60p}} | ||
+ | | | ||
+ | | | ||
+ | | 2.6.18.1 | ||
+ | | 2.2.9 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | Requires "ProcSetting extra_pages_allowance 7500" in hibernate.conf, SATA mode set to compatibility in BIOS and the DMA fix from [[Problems with SATA and Linux]] | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T60}} | ||
+ | | 2007-77G | ||
+ | | | ||
+ | | 2.6.17.14 | ||
+ | | 2.2.7.4 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | Requires "ProcSetting extra_pages_allowance 7500" in hibernate.conf | ||
+ | |- style="background: white;" | ||
+ | | {{T42}} | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | Might require "ProcSetting full_pageset2 1" in hibernate.conf. Fixed in 2.2.9.3 | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T43}} | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T21}} | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | need to unload the sound module (<tt>snd-cs46xx</tt>) on suspend. May want to enable UseDummyXServer if running X | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T21}} | ||
+ | | 2647-4BG | ||
+ | | Ubuntu 6.10 Edgy Eft | ||
+ | | 2.6.17.10 | ||
+ | | 2.2.7.6 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | I used experimental [http://3v1n0.tuxfamily.org/dists/edgy/suspend2/ Trevino's kernel packages] | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{X41T}} | ||
+ | | | ||
+ | | Fedore Core 4 | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | requires SATA resume patch and the SATA drivers compiled as built-in or in initrd (see [[Problems with SATA and Linux]]) and a {{path|hibernate.conf}} fix (see [[Installing Fedora Core 4 on a ThinkPad X41 Tablet]]) | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{X22}} | ||
+ | | | ||
+ | | Ubuntu Breezy | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | see [[Installing Ubuntu (Breezy) on a ThinkPad X22]] | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{G41}} | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | see [[Installing Debian on a ThinkPad G41]] | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{R51}} | ||
+ | | 1829 | ||
+ | | | ||
+ | | 2.6.19.1-suspend2-2.2.9 | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{R51e}} | ||
+ | | | ||
+ | | | ||
+ | | 2.6.16-suspend2-r8 | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | Requires "ProcSetting extra_pages_allowance 8000" in hibernate.conf | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{R52}} | ||
+ | | | ||
+ | | | ||
+ | | 2.6.17.1 | ||
+ | | 2.2.7 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | FC5 with kernel [http://mhensler.de/swsusp/download_en.php 2.6.17-1.2145_1.rhfc5.cubbi_suspend2] | ||
+ | |- style="background: white; color:black;" | ||
+ | | {{T23}} | ||
+ | | 2647-9KU | ||
+ | | Debian Etch | ||
+ | | 2.6.17.4 | ||
+ | | 2.2.7 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | |{{X60s}} | ||
+ | | 1702-55G | ||
+ | | Arch Linux | ||
+ | | 2.6.17.13 | ||
+ | | 2.2.8 | ||
+ | ! style ="color:green;"| Yes | ||
+ | |I use the [http://iphitus.loudas.com/beyond.html beyond] patchset | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | |{{X60s}} | ||
+ | | 1702-E8G | ||
+ | | Gentoo GNU/Linux | ||
+ | | 2.6.20.1 | ||
+ | | 2.2.9 | ||
+ | ! style ="color:green;"| Yes | ||
+ | | gentoo-sources-2.6.20-r8 with swsusp2 2.2.9 and some other patches. Suspend to disk worked ootb (also I tried 2.6.16 / swsusp2 2.2.5 and 2.6.19 / swsusp 2.2.9), but suspend to ram does not (a resume from hibernate-ram results in a fucked up X - console works). Workaround: Use acpi for suspend to ram: echo mem > /sys/power/state | ||
+ | | | ||
+ | |- style="background: white; color:black;" | ||
+ | |{{X61s}} | ||
+ | | 7669-27G | ||
+ | | Gentoo GNU/Linux | ||
+ | | 2.6.24 | ||
+ | | | ||
+ | ! style ="color:green;"| Yes | ||
+ | | 2.6.24-tuxonice-r3. Suspend to disk worked ootb. | ||
+ | | | ||
+ | |||
+ | |- style="background: white; color:black;" | ||
+ | |{{Z61m}} | ||
+ | | 9452-CTO | ||
+ | | Kubuntu Edgy | ||
+ | | 2.6.17.10-generic | ||
+ | | 2.2.9 from experimental repository from http://3v1n0.tuxfamily.org/dists/edgy/suspend2/ | ||
+ | ! style ="color:green;"| Yes | ||
+ | | I have blacklisted these modules: tg3, tp_smapi, hdaps, uhci_hcd (fingerprintreader would not go into suspend), sdhci. More options in the hibernate scripts are "IbmAcpi" and "ProcSetting extra_pages_allowance 15000". SATA mode set to compatibility in BIOS | ||
+ | | | ||
+ | |} | ||
==Installation Instructions== | ==Installation Instructions== | ||
+ | The [http://www.tuxonice.net/ project home page] has a detailed HOWTO and FAQ. The following are just a few highlights. | ||
+ | |||
+ | ===Modifying the initrd generation scripts, and recreate initrd=== | ||
+ | If your systems uses an <tt>initrd</tt> file (most do), you'll need to patch or replace your <tt>initrd</tt>-creation script. | ||
+ | |||
+ | *{{Fedora}} 4: in {{path|/sbin/mkinitrd}}, find this line: | ||
+ | echo "echo Mounted /proc filesystem" >> $RCFILE | ||
+ | and add the following immediately afterwards: | ||
+ | echo "echo > /sys/power/suspend2/do_resume" >>$RCFILE | ||
+ | *{{Fedora}} 5: in {{path|/sbin/mkinitrd}}, find this line: | ||
+ | if [ -z "$noresume" -a -n "$swsuspdev" ]; then | ||
+ | and add the following immediately ''before'' the above: | ||
+ | emit "echo 1 > /sys/power/suspend2/do_resume" | ||
+ | You can also use the [http://atrpms.net/dist/fc5/mkinitrd-suspend2/ mkinitrd-suspend2] package from atrpms. | ||
+ | *{{Debian}}: If your system uses mkinitrd to create the initrd, copy [http://dagobah.ucc.asn.au/swsusp/2.0.0.102/swsusp-initrd.sh swsusp-initrd.sh] script to your {{path|/etc/mkinitrd/scripts}} directory before creating initrd image. If you use initramfs-tools, put a similar script into {{path|/etc/initramfs-tools/scripts/local-top/}} (the manpage of initramfs has templates of example "boot scripts") | ||
+ | |||
+ | In any case, make sure you regenerate your <tt>initrd</tt> file by reinstalling the kernel package or explicitly with mkinitrd or mkinitramfs commands. | ||
+ | |||
+ | ===Hibernate script=== | ||
+ | TuxOnIce works best with the <tt>hibernate</tt> script (available from the project home page), which takes care of auxiliary tasks needed on many systems (e.g., unloading problematic modules and restoring video modes). | ||
+ | |||
+ | ====Availability==== | ||
+ | *{{Gentoo}}: emerge hibernate-script | ||
+ | *{{Fedora}}: kernel and hibernate RPMs are available at http://mhensler.de/swsusp/ | ||
+ | *{{Ubuntu}}: packages for Ubuntu Dapper Drake (kernel, hibernate, suspend2ui-userui): http://dagobah.ucc.asn.au/dapper-kernels/ | ||
+ | *{{Ubuntu}}: experimental packages for Ubuntu Edgy Eft (kernel, hibernate, suspend2ui-userui): http://3v1n0.tuxfamily.org/dists/edgy/suspend2/ | ||
+ | *PLD: poldek -iv hibernate | ||
+ | *Other: check the home page for packages (deb, i386 rpm, tgz, and source rpm) from http://www.tuxonice.net | ||
+ | |||
+ | ==Configuration tips== | ||
+ | === Crash fix === | ||
+ | To avoid pages being resaved during suspend use kernel 2.6.19.2 and suspend2 2.2.9.1 (not stable yet) | ||
+ | OR add the following to | ||
+ | {{path|/etc/hibernate/suspend2.conf:}} | ||
+ | ProcSetting full_pageset2 1 | ||
+ | ===RediSafe-like functionality=== | ||
+ | The hibernate functionality on some ThinkPad BIOSes offers the useful "RediSafe" feature, which suspends to both RAM and disk. This way you get quick resumes (directly from RAM), plus the safey of suspend-to-disk in case the battery runs out. | ||
+ | |||
+ | TuxOnIce provides this feature too; simply add the following to {{path|/etc/hibernate/suspend2.conf}}: | ||
+ | PowerdownMethod 3 | ||
+ | |||
+ | ===Be aware of possible filesystem corruption scenarios=== | ||
+ | Certain usage scenarios can cause filesystem corruption with suspend2. Some details on this are in [http://www.tuxonice.net/HOWTO-4.html#ss4 the project's HOWTO]. None of the workaround configurations fix the problem satisfactorily, so be warned. In particular, with an ext3 root filesystem, if you suspend to swap partition, and then use sysrescCD/Knoppix/some other way to mount the root filesystem read-only, you risk data corruption when you try to resume from the suspended image. | ||
− | + | As far as possible, after suspending the system, don't touch the root filesystem unless you are resuming from it :) | |
+ | [[Category:Patches]] [[Category:Drivers]] | ||
− | == | + | ===ACPI Problem=== |
− | + | Also see [[Problems with ACPI suspend-to-ram]] | |
− | + | ===Resume hangs=== | |
− | + | If the resume process hangs after "Extended CMOS year: 2000" with the boot option no_suspend_console, you my try to enable hpet with hpet=force |
Latest revision as of 00:37, 22 May 2009
TuxOnIce (formerly "Software Suspend 2")TuxOnIce, formerly called as "Software Suspend 2", "suspend2" or "swsusp2", is an implementation of suspend-to-disk functionality in the form of a Linux kernel patch and several userspace utilities. It is an alternative to both the BIOS-driven hibernation feature found on most ThinkPad models, and the swsusp "software suspend" functionality built into recent Linux kernels. |
Features
Compared to the alternatives, TuxOnIce has some unique features:
- Saving the memory image into a swap file, a swap partition or a normal file on any filesystem.
- Cancelling a suspend in progress.
- Different bugs -- if the alternatives don't work, try this one!
It also have the following advantages over swsusp (these features are also provided, in principle, by the not-yet-stable uswsusp):
- The ability to compress the memory image as it is written to disk, thereby reducing suspend and resume times.
- Control over amount of RAM written to disk -- can (optionally) discard cached disk blocks to reduce suspend and resume times.
- Textual and graphical UI (optional).
Since it is implemented purely in software, TuxOnIce is in principle machine-independent and should work on all modern ThinkPad models. However, in some cases problematic drivers need to be unloaded before suspension. This is handled by the hibernate script (see below).
Availability / Project Homepage
Model-specific Status
Thinkpad Model | Type | Operating System | Kernel Version | Suspend2 Version | Success | Note | |
---|---|---|---|---|---|---|---|
240 | 2609-21G | Zenwalk 4.2 | 2.6.18.6 | 2.2.9 | Yes | ||
390X | VectorLinux 5.8 | 2.6.23.1 | svn | Yes | |||
T60p | 2.6.18.1 | 2.2.9 | Yes | Requires "ProcSetting extra_pages_allowance 7500" in hibernate.conf, SATA mode set to compatibility in BIOS and the DMA fix from Problems with SATA and Linux | |||
T60 | 2007-77G | 2.6.17.14 | 2.2.7.4 | Yes | Requires "ProcSetting extra_pages_allowance 7500" in hibernate.conf | ||
T42 | Yes | Might require "ProcSetting full_pageset2 1" in hibernate.conf. Fixed in 2.2.9.3 | |||||
T43 | Yes | ||||||
T21 | Yes | need to unload the sound module (snd-cs46xx) on suspend. May want to enable UseDummyXServer if running X | |||||
T21 | 2647-4BG | Ubuntu 6.10 Edgy Eft | 2.6.17.10 | 2.2.7.6 | Yes | I used experimental Trevino's kernel packages | |
X41 Tablet | Fedore Core 4 | Yes | requires SATA resume patch and the SATA drivers compiled as built-in or in initrd (see Problems with SATA and Linux) and a hibernate.conf fix (see Installing Fedora Core 4 on a ThinkPad X41 Tablet) | ||||
X22 | Ubuntu Breezy | Yes | see Installing Ubuntu (Breezy) on a ThinkPad X22 | ||||
G41 | Yes | see Installing Debian on a ThinkPad G41 | |||||
R51 | 1829 | 2.6.19.1-suspend2-2.2.9 | Yes | ||||
R51e | 2.6.16-suspend2-r8 | Yes | Requires "ProcSetting extra_pages_allowance 8000" in hibernate.conf | ||||
R52 | 2.6.17.1 | 2.2.7 | Yes | FC5 with kernel 2.6.17-1.2145_1.rhfc5.cubbi_suspend2 | |||
T23 | 2647-9KU | Debian Etch | 2.6.17.4 | 2.2.7 | Yes | ||
X60s | 1702-55G | Arch Linux | 2.6.17.13 | 2.2.8 | Yes | I use the beyond patchset | |
X60s | 1702-E8G | Gentoo GNU/Linux | 2.6.20.1 | 2.2.9 | Yes | gentoo-sources-2.6.20-r8 with swsusp2 2.2.9 and some other patches. Suspend to disk worked ootb (also I tried 2.6.16 / swsusp2 2.2.5 and 2.6.19 / swsusp 2.2.9), but suspend to ram does not (a resume from hibernate-ram results in a fucked up X - console works). Workaround: Use acpi for suspend to ram: echo mem > /sys/power/state | |
X61s | 7669-27G | Gentoo GNU/Linux | 2.6.24 | Yes | 2.6.24-tuxonice-r3. Suspend to disk worked ootb. | ||
Z61m | 9452-CTO | Kubuntu Edgy | 2.6.17.10-generic | 2.2.9 from experimental repository from http://3v1n0.tuxfamily.org/dists/edgy/suspend2/ | Yes | I have blacklisted these modules: tg3, tp_smapi, hdaps, uhci_hcd (fingerprintreader would not go into suspend), sdhci. More options in the hibernate scripts are "IbmAcpi" and "ProcSetting extra_pages_allowance 15000". SATA mode set to compatibility in BIOS |
Installation Instructions
The project home page has a detailed HOWTO and FAQ. The following are just a few highlights.
Modifying the initrd generation scripts, and recreate initrd
If your systems uses an initrd file (most do), you'll need to patch or replace your initrd-creation script.
- Fedora 4: in /sbin/mkinitrd, find this line:
echo "echo Mounted /proc filesystem" >> $RCFILE
and add the following immediately afterwards:
echo "echo > /sys/power/suspend2/do_resume" >>$RCFILE
- Fedora 5: in /sbin/mkinitrd, find this line:
if [ -z "$noresume" -a -n "$swsuspdev" ]; then
and add the following immediately before the above:
emit "echo 1 > /sys/power/suspend2/do_resume"
You can also use the mkinitrd-suspend2 package from atrpms.
- Debian: If your system uses mkinitrd to create the initrd, copy swsusp-initrd.sh script to your /etc/mkinitrd/scripts directory before creating initrd image. If you use initramfs-tools, put a similar script into /etc/initramfs-tools/scripts/local-top/ (the manpage of initramfs has templates of example "boot scripts")
In any case, make sure you regenerate your initrd file by reinstalling the kernel package or explicitly with mkinitrd or mkinitramfs commands.
Hibernate script
TuxOnIce works best with the hibernate script (available from the project home page), which takes care of auxiliary tasks needed on many systems (e.g., unloading problematic modules and restoring video modes).
Availability
- Gentoo: emerge hibernate-script
- Fedora: kernel and hibernate RPMs are available at http://mhensler.de/swsusp/
- Ubuntu: packages for Ubuntu Dapper Drake (kernel, hibernate, suspend2ui-userui): http://dagobah.ucc.asn.au/dapper-kernels/
- Ubuntu: experimental packages for Ubuntu Edgy Eft (kernel, hibernate, suspend2ui-userui): http://3v1n0.tuxfamily.org/dists/edgy/suspend2/
- PLD: poldek -iv hibernate
- Other: check the home page for packages (deb, i386 rpm, tgz, and source rpm) from http://www.tuxonice.net
Configuration tips
Crash fix
To avoid pages being resaved during suspend use kernel 2.6.19.2 and suspend2 2.2.9.1 (not stable yet) OR add the following to /etc/hibernate/suspend2.conf:
ProcSetting full_pageset2 1
RediSafe-like functionality
The hibernate functionality on some ThinkPad BIOSes offers the useful "RediSafe" feature, which suspends to both RAM and disk. This way you get quick resumes (directly from RAM), plus the safey of suspend-to-disk in case the battery runs out.
TuxOnIce provides this feature too; simply add the following to /etc/hibernate/suspend2.conf:
PowerdownMethod 3
Be aware of possible filesystem corruption scenarios
Certain usage scenarios can cause filesystem corruption with suspend2. Some details on this are in the project's HOWTO. None of the workaround configurations fix the problem satisfactorily, so be warned. In particular, with an ext3 root filesystem, if you suspend to swap partition, and then use sysrescCD/Knoppix/some other way to mount the root filesystem read-only, you risk data corruption when you try to resume from the suspended image.
As far as possible, after suspending the system, don't touch the root filesystem unless you are resuming from it :)
ACPI Problem
Also see Problems with ACPI suspend-to-ram
Resume hangs
If the resume process hangs after "Extended CMOS year: 2000" with the boot option no_suspend_console, you my try to enable hpet with hpet=force