This is an old revision of the document!
Table of Contents
Hibernation
Hibernation (also known as suspend-to-disk) is method how to power down computer while preserving state of the operating system. Once powered up, operating system will be in the exact state as it was at the time of hibernation.
In Slackware it works out-of-the-box. However, in order to resume successfully from hibernated state, you need to configure bootloader, so it knows where to resume from.
Hibernating
Desktop Environments
KDE, XFCE and other desktop environments offer hibernation from logout screen/menu.
lightweight windows managers
You can hibernate your system from console. Either as root via pm-utils or D-Bus with additional programs as regular user.
pm-utils
Hibernation is done via pm-hibernate
command.
D-Bus
Slackware offers two services to control power management in it's recent releases. UPower and HAL. Since HAL is deprecated in favor of UPower, use HAL in older Slackware releases (from 12.0 to 13.37), otherwise use UPower.
Use one of these command to hibernate your system.
UPower
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \ /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
HAL
$ dbus-send --system --print-reply --dest="org.freedesktop.Hal" \ /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate
Bootloader configuration
Non-LVM setup
LILO configuration
To tell your kernel where to resume from, you need to write the info to lilo.conf
:
append=" resume=/dev/sdaX"
Replace /dev/sdaX
with your actual swap space. Swap partitions are perfect, I think swap files should work too.
LVM setup
LILO doesn't support booting from LVM, therefore you have to create initial ramdisk (initrd). You need one even though your kernel has build-in support for LVM.
You don't have to adjust lilo.conf
because you can set everything resume-related in initrd.
mkinitrd -c -k <kernel-version> -f <fs_type> -m <fs_type> -r <root_partition> -h /dev/volumegroup/swap -L
- -h set your hibernation/swap logical volume
- -L activate LVM
Afterwards, run lilo.
Further reading
- Hibernate to encrypted swap - http://slackware.osuosl.org/slackware-13.1/README_CRYPT.TXT REAME_CRYPT.TXT
Sources
- Original source: http://www.slackwiki.com/Hibernate
- Originally written by Unknown Slacker
- Rewritten by me ( Martin Matějek)