# Tuxonice Hibernate and no resume

## linoleum

Hi,

I've installed 2.6.24-tuxonice-r3 and the related packages to hibernate my Thinkpad x40. I followed http://gentoo-wiki.com/HOWTO_Software_Suspend_v2. I chose to create a dedicated file for the hibernation (the file get created correctly) and hibernate --no-suspend seems to work correctly. When I try to hibernate It seems I do not have problems  (non errors in /var/log/hibernate.log) but then I'm not able to resume. Each time after the hibernation my laptop reboot in the standard way. 

Here my grub.conf

```

title=Gentoo Linux-2.6.24-tuxonice-r3

root(hd0,0)

kernel /kernel-genkernel-x86-2.6.24-tuxonice-r3 root=/dev/ram0 init=/linuxrc ramdisk=8192 rea l_root=/dev/hda3 udev resume=file:/dev/hda3:0x305bf28

initrd /initramfs-genkernel-x86-2.6.24-tuxonice-r3

```

Here my suspend2.conf

 *Quote:*   

> 
> 
> UseSuspend2 yes
> 
> Reboot no
> ...

 

Any idea where to look for the problem?

Thanks

----------

## Hypnos

A silly idea:

Is "resume=file:/dev/hda3:0x305bf28 " on the same text line as the "init= ..." ?

***

Less silly idea:

Any errors or suspicious messages on boot?

----------

## linoleum

 *Quote:*   

> 
> 
> A silly idea:
> 
> Is "resume=file:/dev/hda3:0x305bf28 " on the same text line as the "init= ..." ? 
> ...

 

Yes  :Smile: 

 *Quote:*   

> 
> 
> Any errors or suspicious messages on boot?
> 
> 

 

The only strange thing is that the reboot after the hibernation(the one that should have been a resume) finds some filesystem errors (non contiguous blocks), but it corrects them and boot fine. 

Here the /var/log/hibernate.log

```

Starting suspend at Sat Mar 15 20:01:40 CET 2008

hibernate: [01] Executing CheckLastResume ... 

hibernate: [01] Executing CheckRunlevel ... 

hibernate: [01] Executing LockFileGet ... 

hibernate: [01] Executing NewKernelFileCheck ... 

hibernate: [10] Executing EnsureSwsusp2Capable ... 

hibernate: [11] Executing Swsusp2SetupFilewriter ... 

hibernate: Killing existing filewriter image.

root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev resume=file:/dev/hda3:0x305bf2

8

hibernate: [11] Executing XHacksSuspendHook1 ... 

hibernate: [30] Executing ServicesStop ... 

 * WARNING:  you are stopping a boot service

 * Storing ALSA Mixer Levels ...                                                 [ ok ]

 * Killing processes using ALSA ...                                              [ ok ]

 * Unloading ALSA modules ...                                                   [ ok ]

 * Stopping ntpd ...                                                                   [ ok ]

 * Stopping sshd ...                                                                   [ ok ]

 * Stopping cupsd ...          

hibernate: [59] Executing RemountXFSBootRO ... 

hibernate: [89] Executing SaveKernelModprobe ... 

hibernate: [90] Executing ModulesUnload ... 

hibernate: [91] Executing ModulesUnloadBlacklist ... 

hibernate: [95] Executing XHacksSuspendHook2 ... 

hibernate: [97] Executing ChangeToSwsuspVT ... 

hibernate: [98] Executing CheckRunlevel ... 

hibernate: [98] Executing FullSpeedCPUSuspend ... 

hibernate: [98] Executing Swsusp2ConfigSet ... 

hibernate: [99] Executing DoSwsusp2 ... 

hibernate: Activating suspend ...

```

Here also my "uname -a"

```

Linux version 2.6.24-tuxonice-r3 (root@XXXX) (gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)) #1 SMP Sat Mar 15 14:53:48 CET 2008

```

I have no idea where to look for my mistake.

EDIT+++++

The only "hibernating" sign in dmsg

```

TuxOnIce: FileAllocator: File signature found.

```

but after a new reboot I found in dmesg only the following

```

swsusp: Registered nosave memory region: 000000000009f000 - 00000000000a0000

swsusp: Registered nosave memory region: 00000000000a0000 - 00000000000dc000

swsusp: Registered nosave memory region: 00000000000dc000 - 0000000000100000

```

----------

## Hypnos

Assuming your hibernation is working correctly, then the kernel is not recognizing the tuxonice signature upon resuming.

I wonder if the linuxrc script doesn't handle resuming to files correctly ...

----------

## linoleum

 *Hypnos wrote:*   

> Assuming your hibernation is working correctly, then the kernel is not recognizing the tuxonice signature upon resuming.
> 
> I wonder if the linuxrc script doesn't handle resuming to files correctly ...

 

I feel a bit lost, sorry. How can I check this possible source of problems?

----------

## Hypnos

I'm not sure myself.

Maybe try booting without the initrd?  Probably some of your hardware won't work (depending on how genkernel does things) but at least you can test the hibernation/resume.

If it works, then it means the linuxrc script used to run the initial ramd disk does handle resuming from files correctly.

So, to be explicit, try a grub.conf entry without the 'init' and 'initrd' specifications.

----------

## linoleum

 *Quote:*   

> 
> 
> So, to be explicit, try a grub.conf entry without the 'init' and 'initrd' specifications.
> 
> 

 

If a remove both I get a kernel panic otherwise removing only

```

init=/linuxrc

```

allows the boot with some warning but still no resume. I'm definitely lost!

BTW, thanks a lot for your help

----------

## Hypnos

EDIT:  Try this first --

Pass the 'debug' parameter in your grub entry.  Next time your boot into Gentoo, the initial ram disk will boot you into a debugging shell.  Then, do 'cat /sys/power/tuxonice/resume' to see if it gives the same swapfile as you specified in the grub entry.

If not, continue below ...

***

Ok, I downloaded the genkernel scripts and have taken a look.

It doesn't look like the linuxrc script (the script that boots your computer from the initial ram disk) can handle resuming from a swapfile.  Would be easy enough to fix, but I don't know if you feel comfortable making the fixes yourself.

Do you absolutely need a swapfile for hibernation?  If not, I just recommend using a swap partition, if you have one -- this should "just work."  (If you do this, at least temporarily, you'll know that hibernation/resume works on your computer ...)

If you absolutely need a swapfile, you will need to get your hands dirty -- either learn how to compile and install a kernel yourself, or mess with the linuxrc script that comes with genkernel ...

----------

## g1ul10

I had the same problem. With kernel version 2.6.24-tuxonice-r5 and genkernel version 3.4.10-r1 I was able to suspend but not to resume. I solved my problem following the advice here

https://forums.gentoo.org/viewtopic-t-624854-highlight-resume+genkernel.html

I put the option 'real-resume' on the kernel command line instead of 'resume' and everything seems to work. I use a swap partition, so I'm not sure if this works also with files. It took me several hours of trial and error and web search to find out this solution. I'm wondering why it's not mentioned anywhere in the documentation. Anyway, I hope it can help.

----------

## anz

Interessant! On my laptop x61 following kernel versions worked with hibernate and hibernate-ram without any troubles:

linux-2.6.23-tuxonice-r6

linux-2.6.24-tuxonice-r1/r2/r4/r9

But with (the masked) version

linux-2.6.25-tuxonice-r7

only hibernate-ram works. "Normal" hibernate writes to the swap, but after restarting, the computer reboots normally without resuming. 

Next step was i putting the uuid instead of /dev/<swap partition> in the fstab and the kernel line (in grub.conf). I also tried real-resume instead of resume in the kernel line. All results into normal reboot instead of resuming.

When trying hibernate again i got following error message:

```

hibernate: Suspend reported the following errors:

 - Suspend was aborted (see dmesg).

 - No swapspace was available. Try swapon?

/tmp/tmp.hibernate.rpzjBS: line 6: syntax error near unexpected token `>'

/tmp/tmp.hibernate.rpzjBS: line 6: `[ -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed" ] && echo <unsupported> > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed'
```

... swapon /dev/<swap partition> to get back the swap ...

... hmmm, I just downgraded to the stable linux-2.6.24-tuxonice-r9 and everything is working again (except wlan with iwl4965 and the intel-sound card, which are working with 2.6.25-r7 better).

---Update---

there is a bugzilla entry about the syntax error above:

Hibernation fails with sys-kernel/tuxonice-sources-2.6.25-r1

https://bugs.gentoo.org/show_bug.cgi?id=219887

----------

