de Software Suspend on Linux / Fedora Core / RHEL

Software Suspend with Fedora Core and Redhat Enterprise

If you have a notebook and use it a lot in different places you might looking for a possibility to put it to sleep and wake it up again very fast. On my old Sony Vaio which used APM I could do this with suspend to ram. However my new ASUS M5678N only provides ACPI and suspend to ram (S3-state) is not working here.
Update: actually this is not true any longer. The only problem with the ASUS M5N (M5200N) series seems to be, that the display is not enabled on resume. An easy fix for this is to add acpi_sleep=s3_bios to the kernel commandline, so that the display will be enabled by the bios prior to resume.

Thanks to Tux On Ice (formerly Software Suspend 2) there is a workaround which uses a swap-partition for suspending to disk and resuming from that really fast. However my distribution Fedora Core does not include kernels with Software Suspend, in particular no kernel with version 2. Aside from that the distribution kernels offer a lot of nice features and are working fine. Because of several tweaks with udev and SE-Linux using a vanilla kernel might not be a good idea.

Fedora 20 hibernating with Tux on Ice using the new Heisenbug theme

Fedora 20

With Fedora 20 released and still using the in-kernel swsusp I will of course continue to support TuxOnIce here.

Please be aware that I always concentrate on the most recent version, so while you will still receive updates for Fedora 19, it is recommended to update to Fedora 20 now. I will continue to ship 32- and 64-bit packages. As usual other arches or matching kmod-packages are available at ATrpms. As with the last version I recommend to update Fedora 19 to 20 by using FedUp. If my repository is enabled all necessary updates will be fetched automatically and the only thing you might want to install manually is the new Heisenbug-theme for UserUI.

Fedora 19 resuming with Tux on Ice using the new Schrödingers Cat theme

Fedora 19

Fedora 19 is mostly an update release with new packages. Of course only the in-kernel swsusp is shipped (which still does not work on my notebook, besides also being very slowly).

I will continue supporting TuxOnIce for Fedora by shipping 32- and 64-bit packages and utilities. I will also provide updated kernels for older releases from time to time, but maybe not for all arches. If in doubt please check ATrpms for different arches of my packages, otherwise I strongly suggest to keep up with the pace and update to newer Fedorareleases whenever available (should be piece of cake with FedUp).

Additionally two notes, which also apply for Fedora 18: First, to use userui with fbsplash just add an "gfxterm"-config to your /etc/default/grub and recreate the grub.cfg with "grub2-mkconfig" (see updated documentation on the FB-Splash page). And secondly, using your keyboard hotkeys to issue an hibernation-cycle might result in a hibernation with the in-kernel swsusp. Thanks to Harald Hoyer I added a workaround in the pm-utils-package, which will make systemd use the hibernate-magic from pm-utils.

Fedora 18 resuming with Tux on Ice using the new Spherical-Cow theme

Fedora 18

The biggest change in Fedora 18 is a complete new anaconda with a much more smoother installation experience.

Since Fedora still only ships the in-kernel swsusp I will continue to support TuxOnIce for Fedora, as usual for both 32-bit and 64-bit systems.

Packages and utilities are mostly untouched and should work out of the box for new installs, as well as updating from Fedora 17. While there was a nasty dracut-bug in the earlier versions of Fedora 17, this should no longer the case with Fedora 18. As usual, if any problems are encountered on fresh installs or updates, please drop me a mail.

Fedora 17 hibernating with Tux on Ice using the new Beefy-Miracle theme

Fedora 17

As usual a lot of packages are updated to the current upstream versions with Fedora 17. A brand new theme is shipped as well.

This page will continue to support TuxOnIce on Fedora 17. Packages are provided for both 32-bit and 64-bit systems.

There are some updates to the TuxOnIce stack and packages: one thing is the migration towards a single userui-binary, supporting both text and framebuffer UI. Please make sure that your /etc/hibernate/tuxonice.conf uses "/sbin/tuxoniceui" as UserUI-binary (you can add a "-f" suffix if you want the Framebuffer UI as default).

Furthermore the dracut-module will now install a much more simplistic approach for resuming in the initrd. The upgrade from Fedora 16 should be as smooth as in previous versions though. If you encounter any problems just let me know.

Fedora 16 resuming with Tux on Ice using the new Verne theme

Fedora 16

Fedora 16 brings the usual updates, including Gnome 3.2. As usual a nice new standard theme is introduced.

The biggest change is a migration towards Grub 2. Beside that there a no changes concerning hibernation. TuxOnIce support will be provided for Fedora 16 from this page as usual. Updates and installations work as before. Furthermore 64-bit systems are now fully supported on this page.

If you update without enabling grub2 and use pm-utils (for hibernation from the Gnome3-menu), you might want to remove the symlink in /etc/grub2.cfg to get hibernation to work.

Fedora 15 resuming with Tux on Ice using the new Lovelock theme

Fedora 15

Fedora 15 brings a lot of new features and a new desktop environment. The new standard theme is called lovelock.

No such big changes here. Fedora 15 is fully supported and new updated packages are provided. Installation and updates work as usual.

Fedora 14 hibernating with Tux on Ice using the new Laughlin theme

Fedora 14

Fedora 14 brings the usual updates and bugfixes together with the new standard theme Laughlin.

As usual this page will continue to support Fedora and brings updated packages for Fedora 14. Since there were no big changes since Fedora 13 the installation and updates work as before.

Fedora 13 resuming with Tux on Ice using the new Goddard theme

Fedora 13

Fedora 13 brings a lot of bugfixes. The new standard theme is called Goddard.

TuxOnIce has reached the stable version 3.1. Since Fedora still ships the old swsusp this page will continue to support TuxOnIce on Fedora 13 as usual. Automatic installation and updating should work as before.

Fedora 12 hibernating with Tux on Ice using the new Constantine theme

Fedora 12

With Fedora 12 the early boot process is a lot different now, since dracut is now used to create the ramdisk image. Therefore I created a new module package to enable TuxOnIce support within the bootprocess.

While the kernel was updated to a new version, Fedora still ships the old swsusp and therefore TuxOnIce support will be available from this page for Fedora 12 as usual.

Fedora 11 hibernating with Tux on Ice using the new Leonidas theme

Fedora 11

Fedora 11 brings a lot of updated packages and a new standard theme called Leonidas. Since the old swsusp is still the default hibernation implementation shipped by Fedora I am continuing the TuxOnIce support with Fedora 11 as well.

A new UserUI-theme package for Leonidas is available, as well as updated packages supporting the new version 3.0.1 of TuxOnIce. Automatic installation and updating should work as before.

Fedora 10 hibernating with Tux on Ice using the new Solar theme

Fedora 10

Fedora 10 makes a big step forward by redesigning the boot process. It is a lot faster now and provides nice eyecandy for both text- and framebuffermode. However, still shipping the old in-kernel software suspend breaks this experience, only showing an ugly black screen on hibernation. What is worse, on resume the system looks like frozen (even if it comes back later).

TuxOnIce resolves this issue by being faster and providing progress information on hibernation and resume. When used in framebuffer mode and the new Solar theme provided here, it will seamlessly integrate in the new boot process and provide uninterrupted eyecandy for both, hibernation and resuming.

This page therefore will support Fedora 10, shipping all needed packages for easy integration in Fedora 10. As with Fedora 9 you can install the new pm-utils-tuxonice package for full integrating TuxOnIce to the Gnome- and KDE logout dialogs. Just use the yum repository for automatic installation and updates. Upgrading from any old Fedora Version should work without any hassle.

Fedora 9 hibernating with Tux on Ice

Fedora 9

Fedora 9 still ships old swsusp. On the plus side the default version of pm-utils now supports TuxOnIce out of the box (although not using the hibernate-script, so you have to manually set the approriate userui-binary). Fedora 9 will be supported on this page.

As with Core 5-8 you should use the yum repository for installation and updates. If you upgrade from Core 5, 6, 7 or 8 all packages should be updated automatically and work as before.

Fedora 8 resuming with Tux on Ice

Fedora 8

Suspend 2 was renamed to Tux On Ice in the meantime, but Fedora 8 still ships the old swsusp. So of course Fedora 8 is supported here too.

As with Core 5-7 you should use the yum repository for installation and updates. If you upgrade from Core 5, 6 or 7 all packages should be updated automatically and work as before.

Fedora 7 resuming with Suspend 2

Fedora 7

Concerning hibernation there is no much difference between Fedora Core 6 and 7, so Fedora 7 is supported by this page as well now.

As with Core 5+6 you should use the yum repository for installation and updates. If you upgrade from Core 5 or 6 all packages should be updated automatically and work as before.

Redhat Enterprise Linux 5 resuming with Suspend 2

Redhat Enterprise Linux 5

Also supported now is Suspend 2 for Redhat Enterprise Linux 5.

The setup is the same as with newer Fedore Core Versions. You should use the yum repository for installation and updates.

On request I reenabled the firewire stack and several file systems in the kernel.

Fedora Core 6 resuming with Suspend 2

Fedora Core 6

Nothing much has changed in Fedora Core 6 concerning hibernation (it is still swsusp), so I will support Core 6 as well.

As with Core 5 you should use the yum repository for installation and updates. If you upgrade from Core 5 all packages should be updated automatically and work as before.

Fedora Core 5 resuming with Suspend 2

Fedora Core 5

With Core 5 Fedora finally ships kernels with hibernate support and integrated some tools to use them. However, the kernels only include the old swsusp version, which might create more problems than it solves. There are various reasons to not use the original Fedora version, but Software Suspend 2: it is a lot faster (the time difference for suspend/resume is at least factor two, but most times even factor three to five), the system will be more responsive after resume, it is generally more stable and also includes some eyecandy if you like).

With Fedora Core 5 it is highly recommended to use yum for the installation, which will update your system to use Suspend 2 out of the box (it is not necessary to edit the bootloader configuration any longer and Suspend 2 is integrated into Gnome, just like swsusp is). On Core 5 Suspend 2 will coexist with swsusp, so you can always switch between both versions (by editing /etc/sysconfig/pm).

There are serveral hints and patches circulating on the mailinglists and Wikis how to setup Fedora Core with Software Suspend, but nobody provides original kernel packages with Software Suspend included. This page tries to fill this gap by offering standard distribution kernels with included Software Suspend. These kernels can be used as a drop-in replacement for the original ones.

This page provides several versions of the kernel, from released stable versions to some bleeding edge ones. Most kernels are tested deeply and should work well. Current supported distributions are Fedora Core 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 and 20. Updates are normally provided within the day Fedora publishes an update. All kernels with descriptions can be found on the download page.

Installation on Fedora Core 5, Core 6 and Fedora 7-20 / Redhat Enterprise Linux 5

For Core 5-20/RHEL 5 the installation is done automatically using a yum repository. There are two different repositories you can use, please check the repository page for details. In general you can download suspend2.repo and put it into /etc/yum.repos.d/. That will provide you with all necessary packages for i686 systems. If you need a different architecture (i586, SMP (on FC5) or x86_64) or third party kernel modules, please setup your yum configuration according to ATrpms.

To use the framebuffer splash for suspend and resume you have to download the helper program and the default theme:
# yum install userui-tuxonice userui-tuxonice-theme-fedoraheisenbug (Fedora 20)
# yum install userui-tuxonice userui-tuxonice-theme-fedoraschroedingercat (Fedora 19)
# yum install userui-tuxonice userui-tuxonice-theme-fedorasphericalcow (Fedora 18)
# yum install userui-tuxonice userui-tuxonice-theme-fedorabeefymiracle (Fedora 17)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoraverne (Fedora 16)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoralovelock (Fedora 15)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoralaughlin (Fedora 14)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoragoddard (Fedora 13)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoraconstantine (Fedora 12)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedoraleonidas (Fedora 11)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedorasolar (Fedora 10)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedorawaves (Fedora 9)
# yum install userui-tuxonice-fbsplash userui-tuxonice-theme-fedorainfinity (Fedora 8)
# yum install userui-suspend2-fbsplash userui-suspend2-theme-fedoraflyinghigh (Fedora 7)
# yum install userui-suspend2-fbsplash userui-suspend2-theme-fedoradna (Core 6)
# yum install userui-suspend2-fbsplash userui-suspend2-theme-fedorabubbles (Core 5)
# yum install userui-suspend2-fbsplash userui-suspend2-theme-rhel-tikanga (RHEL 5)
If you do not have an active framebuffer at the moment, you have to enable it by passing at least vga=0x... to your kernel commandline, which is not very difficult, just check the documentation for some hints.

The setup is very easy, in general you need the Suspend 2 kernel and some utilities. With the following command you install a seperate kernel and all the tools without breaking your current installation:
# yum install kernel-suspend2
All you have to do now is to reboot and use the new kernel. You can start the hibernation by typing hibernate in a terminal as root user.
If you also installed the pm-utils (called pm-utils-tuxonice on Fedora 9-20) package you can start the hibernation in Gnome by clicking on "hibernate" in the Logout dialog or just by typing pm-hibernate.

Some tweaks you can make: by editing /etc/hibernate/hibernate.conf you can switch between the UserUI (either text-based or the framebuffer-based graphical splash) and control some events that should happen on suspend/resume.

Furthermore, on Fedora up to version 8 you can control which suspend method should be used by editing /etc/sysconfig/pm (the default is to use Suspend 2 for the kernels from this page and swsusp for the original Fedora ones, but you can also force the usage of a specific implementation).

Starting with Fedora 9 install the pm-utils-tuxonice package and edit /etc/pm/config.d/tuxonice.

Installation on Fedora Core 3 and 4

Now following some instructions how to setup and install Software Suspend on Fedora Core 3 and 4. This will work on other versions too, but you may have to recompile the kernel source RPM. You can also read this section for Core 5-20 if you have problems with the setup above. This page provides only i686 for Core 3, 4 and 5 and uniprocessor systems.

The installation on Fedora Core 4 is very simple as it requires only the installation of four RPM packages and the adding of the resume2 parameter to the kernel commandline. There is a repository with the stable kernel versions from ATrpms which also provides a bunch of prebuilt kernel modules for the suspend kernel. Furthermore I also offer a small yum repository. Please see the Yum Repository section for some more infos. If you are using Fedora Core 4 you might want to skip the following sections install the kernel and utilities using Yum, but check the following steps anyway.

You will need some tools first, which are available as RPM packages from the download page. While newer FC4 kernels include dependencies to these tools, you have to install them manually for FC3 (first, before installing any kernel from this page). You only have to install the tools for the first time, but you should look for updates from time to time. Starting with Fedora Core 4 you will get updated versions when using yum.
Go to the download page and get the hibernate RPM (Note: there is currently a conflict with JPackage, please have a look at the Repository section in how to fix this) and the kernel you want to use (check with # rpm -qv kernel which kernel you have currently installed).
# rpm -ivh hibernate-1.12-1.i386.rpm (install the hibernation script, only needed the first time)
# vi /etc/hibernate/hibernate.conf (edit the configuration file or use my hibernate.conf)

fetch a special version of mkinitrd (optional for FC3, but strongly recommended): 4.1.18 for Core 3 or 4.2.15 for Core 4, and install the RPM:
# rpm -ivh swsusp2-mkinitrd-4.1.18-2.cubbi5.i386.rpm (for Fedora Core 3)
# rpm -ivh swsusp2-mkinitrd-4.2.15-1.cubbi8.i386.rpm (for Fedora Core 4)
This is necessary only for the first time and optional for Core 3 (it will make the installation of a software suspend enabled kernel more easier and create the needed initrd for most systems automatically).

Since suspend 2.2-rc7 you will need the User-UI packages in order to get progress information on suspend/resume. All newer kernels for Core 4 include a requirement for this, so you have to install the following package. If you use Core 3 you only need the package if you want to use the graphical progress information with the framebuffer splash. Please have a look at the User-UI section for some more setup and configuration informations.
For Core 4 please download at least the text version and install the package:
# rpm -ivh swsusp2-userui-0.6.3-0.fc4.cubbi1.i386.rpm

Now install the kernel and edit your boot loader configuration. Please come back from time to time and check for updates and fixes:
# rpm -ivh kernel_version.rpm (install the new kernel RPM)
# vi /etc/grub.conf (edit your boot loader and add resume2=swap:/dev/??? to the kernel command line, where ??? is the name of your swapdevice (when in doubt type # cat /proc/swaps). For lilo edit /etc/lilo.conf and run lilo afterwards)

Congratulations, your are done how, and can reboot to the new kernel.

However if you are using Core 3 without swsusp2-mkinitrd, or you have any problems with your initrd, I will provide some informations in how to edit the initrd and what you need there in order to resume properly (Please note that I strongly recommend to use the swsusp2-mkinitrd package, as it will already take care of setups using LVM or SATA. If it does not work please drop me a note so I can fix it).
Fedora requires an initrd for booting and resuming your system. It is necessary that the initrd is setup correctly so that resuming will work (Again: please use swsusp2-mkinitrd if possible). To edit your initrd and include support for software suspend you you have to modify the initrd in this way:
# cd /root/ && mkdir myinitrd/ && cd myinitrd/ (create temporary directory)
# gzip -dc </boot/initrd-kernel_version.img|cpio -i (unpack the current initrd)
# vi init (edit the init-file and include these two lines after mount -t sysfs ... and before echo Creating /dev (for LVM you have to include these lines after lvm vgmknodes and before echo Creating root device, see comments below):
  echo Activating software suspend
  echo > /proc/software_suspend/do_resume

# find . | cpio -o -c | gzip -9 > /boot/initrd-kernel_version.img (create the new initrd)
# cd .. && rm -rf myinitrd/ (Cleanup)

Now reboot with your new kernel.

Usage of Software Suspend

To use and test Software Suspend just type # hibernate as root (you may want to use sudo with your standard user). You should see some messages about suspending and after a short while the computer should switch off. Hopefully the computer will resume on restarting.

Software suspend allows you to start a different operating system while maintaining the current state. However, you should never change any filesystems which are currently mounted in the hibernated system (which means you should never mount any filesystem read-write). If you do so it might lead to filesystem corruption. If you plan to use a datapartition between two operating systems, you should unmount this partition prior to suspend and remount it on resume (you can do this by adding some commands into your /etc/hibernate/hibernate.conf).
If you know that you have changed a filesystem which was mounted in the hibernated system (or you are unsure) you can tell the kernel to skip any state information by adding noresume2 to the kernel command line (in grub you can do this by pressing "a").

In case of problems have a look in /etc/hibernate/. You may have to blacklist some modules or switch to a text console before hibernating. Have a look on the Suspend 2 project page for recent information and problem solutions.

I would like to get some feedback if everything works for you, or which problems you have. Please do not hesitate to mail me, you normally will receive an answer in a few days.

The new User UI interface

Starting with software suspend 2.1.8.6 there is a new userspace interface for showing the progress information on resume/suspend. It also offers the possibility to use a nice graphical fbsplash progress screen. Since I build newer kernels with the fbsplash patch included you might be interested in a small How-To and packages.

Kernels which use software suspend 2.2-rc7 and newer will not show any progress information, if you do not have setup the User-UI, and configured it in your hibernate.conf.

Some more (now deprecated) hints

These are some more information about the initrd from the time where there was no swsusp2-mkinitrd package. These informations are mostly deprecated and should be only used for older Fedora Core 3 kernels. In general the seperate swsusp2-mkinitrd will do a better job and is available for all supported Fedore Core versions.
However, I will not remove these informations for the moment, since it might help you in understanding how the resume process is started and how you can fix it in case anything went wrong (but then again, please drop me a note so I can fix it). When using the following information, please note that the name of the /proc directory changed in suspend 2.2-rc9 from /proc/software_suspend/ to /proc/suspend2/, so you might have to change the following patches and scripts. Also one important warning: never resume from your /etc/rc.sysinit or any state in the initrd where the root filesystem was already mounted read-write. If you do so the kernel will flush any journaling information and change the filesystem, so that the filesystem will be changed before resuming and lead to filesystem corruptions.

If you do not want to edit your initrd each time you install a new kernel (and have not installed swsusp2-mkinitrd for whatever reason), you might want to edit your mkinitrd. This will not break kernels without software suspend included, but issue a warning since the proc-entry is missing. Thanks to Noboru Sebe for this hint and the following patch:

*** /sbin/mkinitrd.org  2004-10-25 06:59:42.000000000 +0900
--- /sbin/mkinitrd      2005-02-06 07:48:04.000000000 +0900
***************
*** 638,643 ****
--- 638,649 ----
      echo "mount -t sysfs none /sys" >> $RCFILE
  fi

+ #########################################################
+ # for software suspend2
+ echo "echo Activating software suspend" >>$RCFILE
+ echo "echo > /proc/software_suspend/do_resume" >>$RCFILE
+ #########################################################
+
  if [ -n "$USE_UDEV" ]; then
      if [ -n "$UDEV_TMPFS" ]; then
        cat >> $RCFILE <<EOF

Ulrich Kiermayr provided this script which simplifies the process of patching the initrd. Just download the script and call it with the initrd as parameter.
# ./swsusp2initrd.sh /boot/initrd-kernel_version.img

usage of a swap-area in LVM

Many people use the logical volume manager (LVM) and have the swap-partition as logical volume. This will be no real problem, however the setup is slightly different (Thanks for the hints coming from Giorgio Cefaro, Gawain Lynch, Simon Klempert and Marty Vona).

On a standard Fedora Core setup the initrd will already include some lines for activating LVM. All you have to do is to start the resume process after the LVM is activated. Gawain Lynch provided this patch:

--- init.orig   2005-03-10 11:01:40.366230336 +1100
+++ init        2005-03-10 00:12:15.000000000 +1100
@@ -36,6 +36,10 @@
 lvm vgchange -ay
 echo Making device nodes
 lvm vgmknodes
+echo "Loading suspend_lzf.ko module"
+insmod /lib/suspend_lzf.ko
+echo "Activating software suspend"
+echo > /proc/software_suspend/do_resume
 echo Creating root device
 mkrootdev /dev/root
 umount /sys

Please note that my recent kernels do not include modular support of software suspend, so you should not try to load the lzf module any longer. Marty Vona provided this script to setup the initrd.

Gawain Lynch also provided this patch for the /etc/rc.d/rc.sysinit to reformat each swap partition on reboot:

--- rc.sysinit.orig     2005-03-10 10:56:47.641731224 +1100
+++ rc.sysinit  2005-03-10 10:56:24.295280424 +1100
@@ -833,6 +833,9 @@

 # Start up swapping.
 update_boot_stage RCswap
+for swap in `grep -e swap /etc/fstab | cut -d " " -f 1`; do
+       action $"Remaking swap space for ${swap}: " mkswap ${swap}
+done
 action $"Enabling swap space: " swapon -a -e

 # Set up binfmt_misc

Go to the Download section.

MHENSLER.de/swsusp/index_en.php#20131204-175607$1.58  [180321] © Matthias Hensler 2002-12, All Rights Reserved