S2disk

From openSUSE


Warning! Use this document only if your suspend-to-disk is not working

To use Suspend to disk feature you should run KPowersave, right-click on KPowersave icon and click "Suspend to disk" (in KDE). If it fails, you may try methods proposed here.

Contents

Suspend to disk

This is a feature of suspending the operating system to disk to a complete poweroff and then resuming reducing the effective boot time to 60 - 90 seconds (on SuSE, depending on system and workspace load), topping at 30 secs for full working environment to boot for other self-built systems.

Methods

Seems that there are 2 methods of suspend currently implemented in SuSE, but only one working for me:

  • s2disk
  • kernel

the working one is kernel, so I will describe it here:


kernel method

Short intro

The things you will need:

  • an active swap partition
  • a kernel boot parameter resume=/dev/hda<your swap> in grub
  • properly configured and working s2ram (suspend-to-ram, or just suspend or standby)
  • A decent SuSE (10.2) comes with everything else needed

Utilities used:

  • GUI: kpowersave
  • CMI: pm-hibernate

Files affected:

  • /etc/pm/config
  • /boot/grub/menu.lst

Error logs stored at:

  • /var/log/pm-suspend.log
  • /var/run/pm-suspend.inherit stores the last error prevented from suspending

The configuration

All Versions

  • Get your swap name: at console type fdisk -l and remember the path to swap
  • Get s2ram to work (see s2ram)

SuSE 10.3

  • set the parameters found for s2ram (like -f -p -m) to /etc/pm/config.d/modules S2RAM_OPTS="" variable if your computer is not in a white list
  • Set HIBERNATE_METHOD="kernel" in /etc/pm/config.d/hiberante (using your favorite editor as root). The second possible method is "userspace".

SuSE 10.2

  • set the parameters found for s2ram (like -f -p -m) to /etc/pm/config S2RAM_OPTS="" variable if your computer is not in a white list
  • Set HIBERNATE_METHOD="kernel" in /etc/pm/config (using your favorite editor as root)

All Versions

  • Change the line at /boot/grub/menu.lst : add resume=(your swap partition name)
title openSUSE 10.2
  (...)
  kernel /boot/vmlinuz (...)
to:
title openSUSE 10.2
  (...)
  kernel /boot/vmlinuz (...) resume=<your swap>
Warning! Do this carefully!
  • reboot the system, if you have changed menu.lst.

Recommended tricks

To use the full power of hibernate, you may want to map 'poweroff' hardware button to 'pm-hibernate' to forget normal switching and that long booting process forever:

Add these lines to /etc/acpi/events/default :

event=button/power
action=pm-hibernate

to start using it immediately without a reboot you should reload acpid:

/etc/init.d/acpid reload

Note: this only works if acpid is working properly

Note: this will break KDE Power-Off button event configured in KPowersave 0.7.2 and higher