LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Hibernation and suspend to disk (https://www.linuxquestions.org/questions/linux-general-1/hibernation-and-suspend-to-disk-34817/)

Slasher 11-07-2002 06:34 AM

Hibernation and suspend to disk
 
Using Linux (Redhat 8.0) on my laptop, hibernation or suspend to disk where the OS writes everything in RAM to disk and then shuts completely off, is an important feature. I've searched the web, this forum, linux-laptop.net and several other resources, and I'm still stumped.

Main questions are:

Does hibernation/suspend2disk require a supend-partition (primary?) or is a hibernation file (like Windoze uses) sufficient?

I've read that it's not possible to hibernate linux if your bootloader (grub in my case) is located in MBR (also my case), and only possible if it's located on /boot. Is this the case, and if, how do I move my bootloader from MBR to /boot?

Assuming the above problems are solved, what exactly do I have to do to make my linux hibernate? Is there a utility available to make all the appropriate arrangement?

As you've probably understood by now, hibernation/suspend2disk is something I really want to make work, and if anyone have any input at all, it'll be greatly appreciated.

Sorry about the bad english (not my native language), and thanks for reading!

Bert 11-07-2002 07:10 AM

Hello Slasher, welcome to LQ.org

Firstly, in your profile on this forum, it's best to include what distro you're using I know you say it's redhat but as this post gets further down the page, people will have to scroll up and down.

I have grub in the MBR and hibernation works fine. I close the lid to my laptop and it goes into standby. It wakes when I open it and starts the cardbus up too.

It has to be enabled in your kernel. Redhat 8.0 includes it by default I believe, so if your BIOS has it, it should be enabled. What laptop are you running?

vladkrack 11-07-2002 07:18 AM

Hi Slasher,

You could use a program called apm (Advanced Power Management daemon) It can watch your notebook's battery and warn all users when the battery is low, and suspend activi ty too.

I belive grub in MBR has nothing to to with but you could check the man to have sure.

It's in a theres a package called apmd-<version>.

I hopes this help you...

Slasher 11-07-2002 07:26 AM

Hi, thanks for replying Bert and vladkrack.

Forgot to metion, but suspend and apm works fine, I can suspend the machine manually, automaticly or by closing the lid.

The difference between suspend and suspend to disk is that suspend never shut down the entire machine, i.e keeping information in ram (draws power), while suspend to disk copies everything to disk and shuts down completely.

Sorry if I caused any misunderstanding.

Edit: The machin is a Dell Inspiron 4100, I830M.

gig103 11-15-2002 02:49 AM

I am looking to do a "hibernate" feature with linux so i can dump winxp (right now its just so conveninent to be running in 15sec). can i do this with Red Hat 7.3?? If so, how? If not, how can i do it in Red hat 8 .. .which I could download :-)

-Mike

linowes 12-19-2002 10:41 AM

Slasher, did you ever get this to work? I too would like to get hibernate working on my Portege 7200.

Slasher 12-19-2002 04:17 PM

No, never found out how. Still searching.... :)

Bert 12-19-2002 05:04 PM

These folks have a few suggestions, and a few got it working ...

Bert

Slasher 12-19-2002 05:09 PM

True, checked it out som time ago. But I got the impression that it wasn't One good solution, but more tweaking and tuning to get it to work. And it isn't clear whether it's necessary to have a hibernation partition or not. That's why I'm still searching :)

linowes 12-24-2002 09:19 AM

I've read about "swsusp" patches for the Linux kernel, which is "suspend to disk", I think is the same as hibernate (?).

One thread says (I quote):
>>On many laptops, the suspend-to-disk feature is controlled by the BIOS and requires a FAT partition as the first partition on the disk. A DOS utility or its Linux equivalent "phdisk" writes a file ~ the size of the machine's RAM that's composed of contiguous sectors to this partition, then writes the location of the start and end sectors to some secret place in the NVRAM. Then you can trigger the suspend-to-disk feature with a special key sequence regardless of what OS you're running, often Fn-F12.

>>If that doesn't work, the "swsusp" patches for the Linux kernel add similar functions that take slightly longer to complete, but work everywhere.

--
but being a Linux newbie, I'm pretty intimidated by this. And I'd rather work on my laptop than have to repartition and start over.

Slasher 12-25-2002 04:38 PM

I agree. I'm probably gonna wait for a kernel with ACPI support, and hopefully every issue is gonna vanish :P

gig103 08-24-2003 05:06 PM

It has been a while since this thread was touched, and I never got around to installing Linux because of this issue.

Now that Red Hat Linux 9.0 is out, is there any ACPI support? What about the original issue of suspend-to-disk, where the RAM contents are written to the harddrive so that the machine boots faster by restoring everything?

Slasher 08-24-2003 05:17 PM

gig103, to get ACPI in RH 9, one needs to compile it afterwards, there is no generic ACPI support in RH 9.0 (at least to my knowledge). The next RH release will be based on kernel 2.4.21 (I think), which has much better ACPI support (most of the ACPI work done for kernel 2.5 and 2.6 have been inkluded in 2.4.21). Think I got that correct :)

Anyways, if ACPI is a key issue, and you don't vant to compile the lot on your own, it would be wise to either wait for the next RH release or consider another distro.

browny_amiga 09-01-2003 09:54 AM

I just found these links on the subject.

http://sourceforge.net/projects/swsusp
http://fchabaud.free.fr/English/defa...p&FILE2=Swsusp

In case somebody wants to make it work, here is a path how.

I for myself still have to figure out how to apply a diff patch to a kernel.

raylpc 09-01-2003 11:23 AM

just as a reminder, the swsusp patch needs a plain vanilla kernel; it won't work with the RH9 kernel source.

A really brief howto:
1. download a vanilla kernel source from www.kernel.org.
2. su to root.
3. cd /usr/src
4. tar -zxvf kerelxxxxx.gz or tar -jxvf kernelxxxxx.bz2
5. ln -s /usr/src/the_new_kernel /usr/src/linux
6. download the current swsusp patch from http://sourceforge.net/project/showf...group_id=25964.
7. bzip2 -dc < /path_to_the_swsusp_patch | patch -p1
8. make xconfig, enable the software suspend in the general setup section. (plus properly configuring ur kernel, you can find more help from the forum)
9. make dep clean bzImage
10. install the new kernel.
11. download the suspend script from http://sourceforge.net/project/showf...group_id=25964.
12. install the script.
13. append "resume=your swap partion" to ur kernel parameters in grub or lilo.

This is just a very brief summary. For more information, please refer to the swsusp's doc.

P.S.
1. There might be some risk trying that out.
2. before applying a patch, it's a good idea to run with --dry-run option to see if the patch applied cleanly.


All times are GMT -5. The time now is 09:15 PM.