LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Linux Answers > Hardware
User Name
Password

Notices

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:
Code:

# # 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.

Edit /etc/lilo.conf

Add the following to your lilo.conf:
Code:

append="resume=/dev/hda3"

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.

Good luck

by macemoneta on Sun, 2006-03-12 12:49
You have a bad link in your post.

Should point here.

by XavierP on Sun, 2006-03-12 17:47
URL is now fixed.

by Old_Fogie on Sat, 2006-04-22 00:53
Thanks for posting cwwilson. I just did this tonight and I can now get standby via the battery icon in KDE.

I can't get suspend working yet (I freeze, I get black screen and lose X I'm glad I have control+alt+del to do reboot), but I do have two things not in line with your recommended kernel settings. So I was not surprised that I may have a glitch somewhere as I don't meet the minimum recommended.

BUT OMG! YOU INADVERTANTLY GAVE ME BACK MY TAP+DRAG WITH MY TOUCHPAD

Before doing this, I used to have to hit Function+F4 on my laptop to make the mobo initiate the standby (I did not have the option in KDE), which worked well but I could not have the touchpad custom drivers installed, as when I resumed I would totally lose my touchpad! Even control+alt+backspace didnt reset the touchpad! I had to reboot. So up until now I've been running the laptop without the custom touchpad drivers installed, and just using the default touchpad driver in X, but I had no tap + drag.

So after I got my standby to work I decided to experiment and re-try installing the touchpad drivers, thinking to myself "well maybe my touchpad was freezing becuase it looks for a standby signal from KDE and not my mobo. Maybe now it will see some signal from the KDE battery icon and will now standby/resume nicely."

Well to my surprise my guess was right! After installing the touchpad drivers for my custom kernel I can do standby and when I resume I can do tap and drag !

One question if you don't mind, as you are my compile kernel guru hahah

My question is, to get my kernel options "in-line" with your recommended settings, do I simply go into my 2.4 kernel that came with slackware, go to my 2.6.15.3 kernel source directory, run "make xconfig" and just tweak those settings, hit save, then run make and then run make modules install again. Effectively that would in my mind overwrite my 2.6.15.3 kernel and it's respective modules.

Assuming that the above is correct, will I need to re-install my wireless drivers, guarddog firewall, & touchpad drivers. Those are the only items I have actually run an install of while being in this kernel as of present.

Or, should I just copy out the config file, delete the 2.6.15.3 kernel and run a full make all over and reinstall the touchpad, wireless, guarddog.

Thank you in advance. Again sorry if I typed to much, I tend to ramble on.

by cwwilson721 on Sat, 2006-04-22 07:38
Personally, I would start fresh, going from 2.4 to the newest 2.6 kernel with a 'blank' config. But leave the old kernel because I can just about guarantee that the first compile either won't boot, or you'll forget to compile in something like mouse support (Yes, I've done that...)

And good to hear about your touchpad.

And I STILL cannot suspend mine either. Maybe in the coming months.

by Old_Fogie on Sun, 2006-04-23 02:47
lol yea right now everything is great I just dont have a "pen-goo-in" (penguin) if I boot in 2.6 kernel

by cwwilson721 on Sun, 2006-04-23 02:49
Need to configure your framebuffer and video chipset


  



All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration