TuxOnIce
Software Suspend 2 - swsusp2Software Suspend 2, sometimes also called "swsusp2" and "suspend2", 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, Software Suspend 2 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, Software Suspend 2 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 | ||
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 | ||||||
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 | |
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.
Patching mkinitrd
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: copy swsusp-initrd.sh script to your /etc/mkinitrd/scripts directory before creating initrd image.
Make sure you regenerate your initrd file (using mkinitrd or by reinstalling the kernel) after patching mkinitrd.
Hibernate script
Software Suspend 2 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.suspend2.net
Configuration tips
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.
Software Suspend 2 provides this feature too; simply add the following to /etc/hibernate/suspend2.conf:
PowerdownMethod 3