Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
By cwwilson721 at 2006-03-10 22:20
Mini HOW-TO: Hibernate and resume
Problem: You have a system that you need to put to sleep, for whatever reason ( Need to conserve power on a laptop, or want a possibly quicker 'shutdown and reboot').
Solution: Hibernate. It saves everything (Hopefully!) to a file on your hard drive, and when you bring it back up, it was just as you left it.
Sound good? Well, it can be. It can also drive you insane.
I'm going to talk about one route to possible success
Successful hibernation requires a few things in Linux:
* An ACPI compliant system (BIOS, HDD,etc) Well beyond the scope of this post. Check on the web, or take it up with your system manufacturer.
* A newer kernel (Can be done with older kernels, but the benifits outweigh the drawbacks. Get it, compile it, love it)
* A place to store the 'image' at (It defaults to the first swapspace it finds, whether it's a file or partition)
* A small addition to lilo (I don't use grub, and since Slackware ships with lilo, and I'm trying to keep this simple, I'll stick with lilo).
* A program to start the hibernation with. (I use KDE, and has KLaptop builtin. And it works)
Let's take a look in more depth:
Config the kernel
Do a search in this forum, and you'll find as many ways to configure a kernel as there are feathers on a chicken. Find one you like, and use that. For the purposes of this mini how-to, I'll only tell you what is needed for hibernation/ACPI to usually work.
First, you need to enable as much as you can in the ACPI section. Here is my ACPI section from my actual config file:
# # Power management options (ACPI, APM) # CONFIG_PM=y CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set CONFIG_SOFTWARE_SUSPEND=y CONFIG_PM_STD_PARTITION="" # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_SLEEP_PROC_SLEEP=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_VIDEO=y # CONFIG_ACPI_HOTKEY is not set CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_IBM is not set # CONFIG_ACPI_TOSHIBA is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y CONFIG_X86_PM_TIMER=y # CONFIG_ACPI_CONTAINER is not set
Mine works, so you can use it as a guide.
Go ahead and configure/make/install and reboot.
Add the following to your lilo.conf:
Substitute your swap partition or file for '/dev/hda3'
Example: append="/dev/sdd5" or append="/usr/swapfile"
Save, run 'lilo'
Start the process:
I already had KLaptop configured for Hibernation. It's in the ACPI tab. You'll need to know the root password to get the 'Helper Applications' working.
Now if you right click on Klaptop in the system tray, one option is 'Hibernate'
Click it. Your system SHOULD saave everthing, then turn off.
To restart, just press your power button. It will start the regular boot process, but will veer off into the resume.
As I said, this is a MINI how-to. There are programs to get you hibernating from the command line, and other utilities to do the same in your Desktop Enviornment as Klaptop.