LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Closed Thread
 
Search this Thread
Old 03-10-2006, 02:50 AM   #1
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 66
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



 
Old 03-10-2006, 07:56 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,791
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Nice piece of work! Have you submitted it to the Tutorials section? I know this is somewhat Slackware specific, but having this in Tutorials (or maybe the Wiki) would make it harder to lose.
 
Old 03-10-2006, 08:01 AM   #3
enine
Member
 
Registered: Nov 2003
Distribution: Slackware 14.1
Posts: 819
Blog Entries: 3

Rep: Reputation: 91
Should add info on how to setup suspend as well. I don't like to wait for the hibernation file to write and read from the drive so I stick with suspend unless I'm going to be away from power for a long time. I've gottne mine to where it will boot just about as fast as reading the hibernation file.
 
Old 03-10-2006, 09:55 PM   #4
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by Hangdog42
Have you submitted it to the Tutorials section? I know this is somewhat Slackware specific, but having this in Tutorials (or maybe the Wiki) would make it harder to lose.
Not yet, because of the following ommision:
Quote:
Originally Posted by enine
Should add info on how to setup suspend as well.
The ONLY reason that I have not is that I haven't tried/worked it out yet. Maybe this weekend.

Thanks for the 'Thumbs Up' on this.
 
Old 03-10-2006, 10:13 PM   #5
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 66
OK...been trying 'suspend' and it won't resume. I'll work on it, but in the meantime, I think I'll keep this thread as "Hibernate and Resume"

When I get 'suspend' to work, I'll try to make a new mini how-to
 
Old 03-11-2006, 12:36 AM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
You might want to consider submitting this as a Linux Answer tutorial.
 
Old 03-11-2006, 02:32 AM   #7
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
about the script in the previous thread??

what about sleeping, after some time if the system remains idle (as in xp)
and u can fix the time also

Last edited by rkrishna; 03-11-2006 at 02:43 AM.
 
Old 03-11-2006, 02:41 AM   #8
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
this is one of my friends mail to me --for using suspend
-------
I use suspend with slack on my la top. You need to download the source
for
the latest 2.6.xx kernel. Then download software suspend 2 patches by
searching it in slack packages. You need to compile the kernel after
applying
the patch. For this, I attach a .config file that I use on my laptop.
Put it
in the source directory. type make oldconfig and then run make
menuconfig.
You must then edit the suspend2 path with the path of the swap
partition on
your disk at two places in the menuconfig suspend2 subitem menu. Make
sure to
apply the patch before copying the .config file.
-------------
if i need to post the .config i can, i have it with me
 
Old 03-11-2006, 12:07 PM   #9
cathectic
Member
 
Registered: Sep 2004
Location: UK, Europe
Distribution: Slackware64
Posts: 761

Rep: Reputation: 34
Quote:
Then download software suspend 2 patches by searching it in slack packages.
You don't need Suspend2 to suspend - only if swusp with the kernel doesn't work for you.

Also, you may well need to fiddle with kernel options in the append line to get suspend/ resume working properly.

e.g.

My Acer Aspire 5021WLMi requires a 2.6.16-rc kernel and the append line "noapic pci=routeirq" to suspend and resume properly.
 
Old 03-11-2006, 01:26 PM   #10
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by cathectic
My Acer Aspire 5021WLMi requires a 2.6.16-rc kernel and the append line "noapic pci=routeirq" to suspend and resume properly.
That's the type of thing I'm trying to accomplish- Getting stuff to work 'out-of-the-box', without downloading new things (with the exception of the kernel. It's a required thing for most new hardware to work, anyway).
Not that I have an aversion to new software, but I want to push the limits on what is already on the stock install.....
 
Old 03-11-2006, 03:34 PM   #11
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 66
Well, still having problems getting this old laptop to suspend. It's no big deal, hibernate is my preference anyways.

Actually, now that I think about it, it never suspended in XP either...Maybe the hardare is just not up to the task.

Thanks for the ideas...

Next step: Format/reload with all my notes, etc, to get this thing dead on where I want it, with nothing extra....
 
Old 03-13-2006, 04:44 PM   #12
enine
Member
 
Registered: Nov 2003
Distribution: Slackware 14.1
Posts: 819
Blog Entries: 3

Rep: Reputation: 91
mine suspends fine with linux but using just apm instead of acpi.
I've never tried hibernate in linux, never carded to wait for it to read the hibernation file in windows, took forever.

Last edited by enine; 03-13-2006 at 04:49 PM.
 
Old 03-13-2006, 04:54 PM   #13
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
Since the Tutorial is here and it has it's own Discussion Thread, I have closed this one.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
no fan control after hibernate resume on NC6000 jlinkels Linux - Laptop and Netbook 5 03-17-2006 07:38 AM
Fedora Core 5 T2 resume from hibernate IBall Fedora 0 02-05-2006 10:58 PM
mini Ipod patch usb (the mini iPOD thread) Phyrexicaid Linux - Hardware 6 03-22-2005 02:07 AM
Can I Hibernate? ernesto_cgf Linux - Software 3 12-23-2004 03:22 AM
hibernate demmylls Linux - General 3 09-12-2003 04:47 PM


All times are GMT -5. The time now is 01:42 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