From kernel/suspend.c: * BIG FAT WARNING ********************************************************* * * If you have unsupported (*) devices using DMA... * ...say goodbye to your data. * * If you touch anything on disk between suspend and resume... * ...kiss your data goodbye. * * If your disk driver does not support suspend... (IDE does) * ...you'd better find out how to get along * without your data. * * If you change kernel command line between suspend and resume... * ...prepare for nasty fsck or worse. * * (*) pm interface support is needed to make it safe. You need to append resume=/dev/your_swap_partition to kernel command line. Then you suspend by echo 4 > /proc/acpi/sleep. Pavel's unreliable guide to swsusp mess ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two versions of swap suspend in the kernel, the old "Pavel's" version in kernel/power/swsusp.c and the new "Patrick's" version in kernel/power/pmdisk.c. They provide the same functionality; the old version looks ugly but was tested, while the new version looks nicer but did not receive so much testing. echo 4 > /proc/acpi/sleep calls the old version, echo disk > /sys/power/state calls the new one. [In the future, when the new version is stable enough, two things can happen: * the new version is moved into swsusp.c, and swsusp is renamed to swap suspend (Pavel prefers this) * pmdisk is kept as is and swsusp.c is removed from the kernel] Article about goals and implementation of Software Suspend for Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Author: G‚ábor Kuti Last revised: 2003-10-20 by Pavel Machek Idea and goals to achieve Nowadays it is common in several laptops that they have a suspend button. It saves the state of the machine to a filesystem or to a partition and switches to standby mode. Later resuming the machine the saved state is loaded back to ram and the machine can continue its work. It has two real benefits. First we save ourselves the time machine goes down and later boots up, energy costs real high when running from batteries. The other gain is that we don't have to interrupt our programs so processes that are calculating something for a long time shouldn't need to be written interruptible. Using the code You have two ways to use this code. The first one is is with a patched SysVinit (my patch is against 2.76 and available at my home page). You might call 'swsusp' or 'shutdown -z