Install Uswsusp
Ubuntu GNU Just
sudo aptitude install Uswsusp
Arch GNU System
sudo pacman-s uswsusp
The following two paragraphs http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu skip, directly to the last let gnome (or HAL) instead of USWSUSP mode hibernate
Modify Configuration/etc/suspend.conf (Ubuntu is automatically configured and the files under Ubuntu are/etc/uswsusp.conf)
To
Resume device = <path_to_resume_device_file>
The <path_to_resume_device_file> in is changed to your swap as
Resume device =/dev/sda2
Uswsusp can also compress memory mirrors, not only to make swape partitions much smaller than memory, but to speed up the recovery process (because of the reduced time to read hard drives).
Remove the comment in front of the compress, i.e.
Compress = y
Add a row to the end of the file and clearly set the system to shutdown instead of rebooting.
Shutdown method = Shutdown