|Summary help replacing me|
|Describes installing, configuring and using TuxOnIce, an advanced suspend/hibernate framework.|
|Suspending to RAM with hibernate-script|
|Suspending to Disk with hibernate-script|
This is a quick start guide for installing TuxOnIce (formerly suspend2), an advanced suspend/hibernate framework which supports suspending to a swap-disk or a regular file with fast LZO-compression. Visit the TuxOnIce website for a full list of features.
Preparing the kernel
TuxOnIce consists of a kernel patch, plus an optional user interface. Only the kernel patch is necessary, the user interface merely provides a graphical interface displayed during the hibernation/resume cycle.
You can use the linux-pf packages available in the Arch User Repository. They automate all the patch routines, the compilation and installation of the kernel, and the regeneration of the initramfs with an appropriate hook. You maintain control over the install process, and its easy to make changes if you want to repeat the process. More detailed information at installing linux-pf and configuring it with TuxOnIce can be found at its wiki page.AUR or the
Otherwise, you need to patch, configure and compile your own kernel, visit Kernel Compilation From Source and Kernel Compilation with ABS for instructions. The required patch can be obtained from the TuxOnIce website mentioned above.
Next, install the AUR which we will use to call TuxOnIce. Hibernate-script is the default script developed by the TuxOnIce development team.AUR package from the
The configuration files for hibernate-script are in
/etc/hibernate, we will get back to them shortly.
Recreating the initramfs
If you use an initramfs (default Arch systems do), you must add the resume hook in the HOOKS in the configuration of mkinitcpio. Additionally, if you want to speed things up by using LZO compression, add the lzo module to the MODULES array in the same file.
MODULES="lzo" HOOKS="base udev autodetect pata scsi sata resume filesystems"
(for linux-pf you also need tuxonice_compress, tuxonice_swap and optionally tuxonice_userui in MODULES)
Rebuild the initramfs:
# mkinitcpio -p linux-ice
# mkinitcpio -p linux-pf
Setting up the bootloader
Before your can use the suspend function, you need to add the
resume parameter in your bootloader (unless you have hard-coded your swap partition during the kernel configuration). The resume parameter points to the swap partition or swap file, below are the steps involved for both methods.
Suspend to swap partition
Set the swap method (make sure the right partition is indicated) in
Suspend to swap file
If you use a swap file instead of a swap partition, you will need to pass the location of its header to TuxOnIce. TuxOnIce can list all available swap headers.
Use the given string as-is in both
/etc/hibernate/tuxonice.conf and passed to your kernel as a resume parameter.
Append the following to your kernel parameters in your bootloader's configuration file:
Suspend to file
For the file allocator, you will have to prepare a hibernation file. This is different from the standard swap file in that this file is ONLY used for hibernation and not as a general system swap file. The previous method is recommended as being more efficient in terms of disk space. First configure the
/etc/hibernate/tuxonice.conf file, uncomment the "FilewriterLocation" option:
FilewriterLocation /suspend_file 1000
1000 is the amount of disk space reserved for the hibernation file, in this case 1000 megabytes. Usually an amount of 50% - 75% of your total amount of RAM will suffice.
Next, we need to create the file, something like :
# echo TuxOnIce > /suspend_file # dd if=/dev/zero bs=1M count=1000 >> /suspend_file # echo /suspend_file > /sys/power/tuxonice/file/target # cat /sys/power/tuxonice/resume
The output of
/sys/power/tuxonice/resume is what you need to pass to your kernel. You should see something like
file:/dev/sda2:0xdc008, in which case you should append
resume=file:/dev/sda2:0xdc008 as a kernel parameter in your
/etc/lilo.conf file (for LILO),
/boot/syslinux/syslinux.cfg (for syslinux) or
/boot/grub/grub.cfg (for Grub2).
Suspending and resuming
With hibernate-script, your preferred hibernation method can be set in the file
/etc/hibernate/hibernate.conf. See Suspending to Disk with hibernate-script for more info.
Additional pm-utils setup
Configuration made in
/etc/hibernate/hibernate.conf is still useful, but some options don't seem to be used by pm-utils. Compression, for example, will default to lzo unless more action is taken.
Editing files under
/etc/pm/sleep.d/ is a good way to make sure wanted settings are used.
To change the compressor used by TuxOnIce, for example, edit
/etc/pm/sleep.d/00doit and add a line like so:
#!/bin/bash case $1 in hibernate) #Possible compressors include lzo, lzf, and none echo none > /sys/power/tuxonice/compression/algorithm ;;
Additional lines can be used to change other options, such as the default logging level (found in
userui - user interface for TuxOnIce (optional)
Optionally, you can use a text or graphical (Fbsplash) interface with a progress bar with TuxOnIce. To do this, install the AUR package from the AUR.
/etc/hibernate/tuxonice.conf, set the desired user interface:
ProcSetting userui_program "/usr/sbin/tuxoniceui" # Text interface
ProcSetting userui_program "/usr/sbin/tuxoniceui -f" # Graphical fbsplash interface
The fbsplash interface also needs a symlink to the fbsplash theme, like so:
# ln -s /etc/splash/arch-banner-noicons/ /etc/splash/tuxonice
Without this symlink, there will be no progress indicators during suspend/resume.
It is probably necessary to regenerate the initramfs after changing the symlink above.
The text interface may be good for debugging TuxOnIce, as it displays some messages.
You won't see a user interface for the first few seconds of the resume process unless you add the userui hook to your mkinitcpio (before the resume hook) configuration and regenerate your initramfs, but this is also optional.
# mkinitcpio -p linux-ice
To test if userui works, switch to a text console and run:
# tuxoniceui --test
For the graphical interface run:
# tuxoniceui -f --test
- The TuxOnIce website and TuxOnIce wiki are excellent sources of documentation.
- More general information about suspend/hibernate with hibernate-script can be found on the Suspend to Disk page of this wiki. This also covers some advanced topics like problems with specific hardware and configurations.
- Another good source of information is the Gentoo wiki