[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Hibernation

Hibernation (also known as suspend-to-disk) is a method used to power down a computer while preserving the state of the operating system. Once powered up, the operating system will be in the exact state as it was at the time of hibernation.

In Slackware, hibernation works out-of-the-box. However, in order to resume successfully from a hibernated state, you need to configure the bootloader so it knows where to locate the resume data.

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 specially adjust lilo.conf because you can set everything resume-related in initrd.

mkinitrd -c -k <kernel-version> -f <fs_type> -m <modules_required_to_boot> -r <root_partition> -h /dev/volumegroup/swap -L
  • -h set your hibernation/swap logical volume
  • -L activate LVM

Next step is to make sure your lilo.conf contains following snippet

image = /boot/vmlinuz
  root = /dev/sdaX
  initrd = /boot/initrd.gz
  label = Slackware
  read-only # Partitions should be mounted read-only

Afterwards, run lilo to save changes.

$ lilo

Further reading

Sources

 howtos:hibernation ()