# Hibernating hibernates, but does not resume

## optiluca

Hi all.  I have been trying to set up hibernation for a while now, but I am suffering from a rather annoying issue.  My laptop will seem to successfully hibernate on shutdown, but on the next startup the system will boot as normal, completely ignoring any hibernation image that swap should hold   :Confused: 

I am using Tuxonice, pm-utils 1.2.6.1, swap is /dev/sda7 and my kernel boot line is this (I know zen sources are unsupported, but I figured the problematic thing here are the tuxonice patches, or maybe some other setup issue in my system...)

```
title Gentoo Linux (Zen-Sources)

root (hd0,5)

kernel /boot/linux-2.6.32-zen6 root=/dev/sda8 video=uvesafb:mtrr=3,ywrap,1024x768-24@60 resume=swap:/dev/sda7 splash=silent,theme:gentoo quiet console=tty1

initrd (hd0,5)/boot/fbsplash-initrd
```

Does anyone have any ideas as to what could be wrong?  Googling around seemed to give nothing other than "check your swap partition is correct", which it is  :Razz: 

Thanks in advance   :Very Happy: 

----------

## tuber

Could you please post the contents of the init script (or is it linuxrc) from your initrd?

----------

## optiluca

 *tuber wrote:*   

> Could you please post the contents of the init script (or is it linuxrc) from your initrd?

 

Would that be this?

```
zcat /boot/fbsplash-initrd | cpio --list

.

root

lib64

lib64/splash

lib64/splash/proc

lib64/splash/sys

etc

etc/splash

sbin

sbin/fbcondecor_helper

sbin/splash_helper

dev

dev/tty0

dev/console

dev/misc

dev/null

dev/vc

dev/fb

1099 blocks
```

Thanks for your help  :Smile: 

----------

## aCOSwt

By which mean do you hibernate ?

Thanks to the hibernate-script package tools ?

----------

## optiluca

 *aCOSwt wrote:*   

> By which mean do you hibernate ?
> 
> Thanks to the hibernate-script package tools ?

 

Clicking on the "Suspend to Disk" entry in the KDE menu, which runs pm-hibernate I believe.  I do not have hibernate script installed as it provides redundant functionality to what pm-utils offers, and pm-utils is a dependency for some of my packages.  I believe hibernate-script offers a finer configuration control, but nothing that I need.

----------

## tuber

I use the "hibernate" script, in case it makes a difference. If you're using an initramfs, I think you need the init script. See the initrd/initramfs section of http://www.tuxonice.net/HOWTO-2.html#ss2.4. In the init script, you tell the kernel to resume from a previous image.

----------

## john.newman

hibernate-script works out of the box mostly

what you are using does not work.  I would opt for emerge hibernate-script

----------

## optiluca

I was attempting to use an initrd to get my bootsplash to display earlier on boot but failing miserably.  I all honesty I really do not know how to mess with an initrd, as I only used the splash_geninitramfs tool to generate it.  I looked at the gentoo wiki article and tried adding an "init" executable file with the 

```
echo 1 > /sys/power/tuxonice/do_resume
```

 line, and all I got on boot was a kernel panic as it claimed it could not find the file.  I disabled the initramfs entirely by commenting it out in grub.conf, and emerged hibernate-script.  I run "hibernate" as root, and my laptop seems to suspend successfully.  I boot it up, and once again no luck.  I get a perfectly normal boot, with a particularly annoying "removing stale hibernate images [OK]" message...

----------

## mikegpitt

With tuxonice I always use the resume2 parameter...  I'm not sure if it is still necessary or not.  In your case it would read like this:

```
resume2=/dev/sda7
```

----------

## optiluca

 *mikegpitt wrote:*   

> With tuxonice I always use the resume2 parameter...  I'm not sure if it is still necessary or not.  In your case it would read like this:
> 
> ```
> resume2=/dev/sda7
> ```
> ...

 

No luck unfortunately  :Sad:   I just tried booting my gentoo-sources kernel and that does resume from hibernation successfully so this is clearly a tuxonice related issue here...

----------

## Odysseus

optiluca, I run the zen kernel which includes the Tux-on-ice patches on my laptop.  First thing you need to do is make sure you've properly enabled Tux-on-Ice in your kernel config and that these options are compiled-in and not modules. Next regardless of whether you've installed pm-utils or not you do need to install the hibernate script this is an official part of TOI and suspend-to-disk won't work properly without it. If you want to use the frame buffer during shutdown/resume then you'll also need to install tuxonice-userui.

Here are the key parts needed for correct Tuxonice kernel config for my Intel Pentium-M Centrino laptop:

```
#

# Power management and ACPI options

#

CONFIG_PM=y

# CONFIG_PM_DEBUG is not set

CONFIG_PM_SLEEP=y

CONFIG_SUSPEND=y

CONFIG_SUSPEND_FREEZER=y

CONFIG_HIBERNATION_NVS=y

CONFIG_HIBERNATION=y

CONFIG_PM_STD_PARTITION=""

CONFIG_TOI_CORE=y

#

# Image Storage (you need at least one allocator)

#

CONFIG_TOI_FILE=y

CONFIG_TOI_SWAP=y

#

# General Options

#

CONFIG_TOI_CRYPTO=y

CONFIG_TOI_USERUI=y

CONFIG_TOI_USERUI_DEFAULT_PATH="/usr/local/sbin/tuxoniceui_text"

# CONFIG_TOI_KEEP_IMAGE is not set

CONFIG_TOI_REPLACE_SWSUSP=y

# CONFIG_TOI_IGNORE_LATE_INITCALL is not set

CONFIG_TOI_DEFAULT_WAIT=25

CONFIG_TOI_DEFAULT_EXTRA_PAGES_ALLOWANCE=2000

CONFIG_TOI_CHECKSUM=y

CONFIG_TOI=y

CONFIG_PM_RUNTIME=y

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_PROCFS=y

CONFIG_ACPI_PROCFS_POWER=y

# CONFIG_ACPI_POWER_METER is not set

CONFIG_ACPI_SYSFS_POWER=y

CONFIG_ACPI_PROC_EVENT=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

CONFIG_ACPI_PROCESSOR=y

# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_PCI_SLOT=y

CONFIG_X86_PM_TIMER=y

# CONFIG_ACPI_CONTAINER is not set

CONFIG_ACPI_SBS=y

# CONFIG_SFI is not set

CONFIG_X86_APM_BOOT=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

CONFIG_APM_CPU_IDLE=y

# CONFIG_APM_DISPLAY_BLANK is not set

# CONFIG_APM_ALLOW_INTS is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

# CONFIG_CPU_FREQ_STAT is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=y

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

# CONFIG_X86_POWERNOW_K8 is not set

# CONFIG_X86_PHC_K8 is not set

# CONFIG_X86_GX_SUSPMOD is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

# CONFIG_X86_SPEEDSTEP_ICH is not set

# CONFIG_X86_SPEEDSTEP_SMI is not set

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

# CONFIG_X86_E_POWERSAVER is not set

# CONFIG_X86_CPUFREQ_EEEPC900 is not set

#

# shared options

#

# CONFIG_X86_SPEEDSTEP_LIB is not set

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

```

Of course you would need to adjust depending on your hardware. This is just an example. Remember that if you want to use "suspend to disk" you need to have a swap file at least as large as the amount of your installed RAM or create a file elsewhere for TOI to use that is that large.

On my system using the above parameters, the 2 TOI helper apps mentioned earlier, and acpid which is started at the default run-level; I can suspend to disk or suspend to ram using the KDE dialogues with no problems, and no modifications on my part. In essence once these things are installed TOI should work automatically.

One more thing I just remembered when I was setting this machine up. Some BIOS (like mine) are older and have an issue with drives larger than 128-137gigs. In this case you need to set up your drive so that all of your "/boot", "swap", and "/" partitions reside within that 128gig barrier. The rest of your partitions can reside outside of this barrier with no problems, but Grub, Lilo, and TOI all have issues if the drive is setup incorrectly.

I hope this helps.

Ciao,

Odysseus

----------

## optiluca

Hey thanks for your help  :Smile:   I changed a few settings to match your kernel (specifically I emptied the CONFIG_PM_STD_PARTITION="" field, as well as some other settings).  Tuxonice now shows signs of life upon boot, as I see mentions of it appear briefly during bootup.

Somehow I have lost my swap partition entirely, however....

dmesg output when I attempt to run "hibernate"

```
[  304.709821] TuxOnIce 3.0.99.46, with support for checksumming, usm, [compression], block i/o, swap storage, userui.                                          

[  304.710210] TuxOnIce: Unable to find a signature. Could you have moved a swap file?                                                                          

[  304.710214] TuxOnIce: Block I/O: No signature found at /dev/sda7.                                                                                            

[  304.710392] TuxOnIce: Unable to find a signature. Could you have moved a swap file?                                                                          

[  304.710395] TuxOnIce: Block I/O: No signature found at /dev/sda7.                                                                                            

[  304.710397] TuxOnIce: Hibernation is disabled.                                                                                                               

[  304.710398] This may be because you haven't put something along the lines of                                                                                 

[  304.710399]                                                                                                                                                  

[  304.710400] resume=swap:/dev/hda1                                                                                                                            

[  304.710400]                                                                                                                                                  

[  304.710401] in lilo.conf or equivalent. (Where /dev/hda1 is your swap partition).                                                                            

[  304.710404] Cleaning up...                                                                                                                                   

[  304.710452] TuxOnIce debugging info:                                                                                                                         

[  304.710453] - TuxOnIce core  : 3.0.99.46                                                                                                                     

[  304.710453] - Kernel Version : 2.6.32-zen6                                                                                                                   

[  304.710454] - Compiler vers. : 4.4                                                                                                                           

[  304.710455] - Attempt number : 0                                                                                                                             

[  304.710456] - Parameters     : 4194305 667656 0 1 0 0                                                                                                        

[  304.710456] - Overall expected compression percentage: 0.                                                                                                    

[  304.710457] - Checksum method is 'md4'.                                                                                                                      

[  304.710458]   0 pages resaved in atomic copy.                                                                                                                

[  304.710459] - Block I/O inactive.                                                                                                                            

[  304.710460] - Swap Allocator enabled.                                                                                                                        

[  304.710460]   Swap available for image: 0 pages.                                                                                                             

[  304.710461] - No I/O speed stats available.                                                                                                                  

[  304.710462] - Extra pages    : 0 used/2000.                                                                                                                  

[  304.710463] - Result         : Hiberation was aborted.                                                                                                       

[  304.710464]                  : We can't hibernate at the moment (invalid resume= or filewriter target?).                                                     

[  306.679143] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 118 us                                                                         

[  650.926390] uhci_hcd 0000:00:1d.0: release dev 2 ep81-INT, period 8, phase 4, 118 us                                                                         

[  653.826455] TuxOnIce 3.0.99.46, with support for checksumming, usm, [compression], block i/o, swap storage, userui.                                          

[  653.850367] TuxOnIce: Unable to find a signature. Could you have moved a swap file?                                                                          

[  653.850372] TuxOnIce: Block I/O: No signature found at /dev/sda7.                                                                                            

[  653.850577] TuxOnIce: Unable to find a signature. Could you have moved a swap file?                                                                          

[  653.850580] TuxOnIce: Block I/O: No signature found at /dev/sda7.                                                                                            

[  653.850583] TuxOnIce: Hibernation is disabled.                                                                                                               

[  653.850583] This may be because you haven't put something along the lines of

[  653.850584]

[  653.850585] resume=swap:/dev/hda1

[  653.850586]

[  653.850586] in lilo.conf or equivalent. (Where /dev/hda1 is your swap partition).

[  653.850590] Cleaning up...

[  653.850639] TuxOnIce debugging info:

[  653.850640] - TuxOnIce core  : 3.0.99.46

[  653.850641] - Kernel Version : 2.6.32-zen6

[  653.850641] - Compiler vers. : 4.4

[  653.850642] - Attempt number : 0

[  653.850643] - Parameters     : 4194305 667656 0 1 0 0

[  653.850644] - Overall expected compression percentage: 0.

[  653.850645] - Checksum method is 'md4'.

[  653.850645]   0 pages resaved in atomic copy.

[  653.850646] - Block I/O inactive.

[  653.850647] - Swap Allocator enabled.

[  653.850648]   Swap available for image: 0 pages.

[  653.850648] - No I/O speed stats available.

[  653.850649] - Extra pages    : 0 used/2000.

[  653.850650] - Result         : Hiberation was aborted.

[  653.850651]                  : We can't hibernate at the moment (invalid resume= or filewriter target?).

[  655.788136] uhci_hcd 0000:00:1d.0: reserve dev 2 ep81-INT, period 8, phase 4, 118 u
```

And attempting to rescue it...

```
swapon /dev/sda7

swapon: /dev/sda7: read swap header failed: Invalid argument
```

Help?   :Confused: 

EDIT: Ran mkswap /dev/sda7 followed by swapon /dev/sda7 and my swap lives on....  Why the hell did that happen??

Anyway the system now suspends/resumes, but I get an awful lot of video artifacts upon resume (white boxes everywhere).  I assume this is an nvidia related issue, but it doesn't occur using the standard kernel hibernation   :Confused: 

Also, my userspace app is in /sbin (as opposed to /usr/local/sbin as per your example.  Did you install it there explicitly or something?)  I set the kernel up to point to /sbin/tuxonice_fbsplash, but upon resume I got a "Failed to launch userspace program /sbin/tuxonice_fbsplash Error -2"

Thanks for your help  :Smile: 

----------

## mikegpitt

 *optiluca wrote:*   

> Somehow I have lost my swap partition entirely, however....

 Do you have the hibernate-cleanup init script in your boot runlevel?

----------

## optiluca

 *mikegpitt wrote:*   

>  *optiluca wrote:*   Somehow I have lost my swap partition entirely, however.... Do you have the hibernate-cleanup init script in your boot runlevel?

 

```
rc-update show

                 wicd |        default                                

            killprocs |                                       shutdown

              vnstatd |        default                                

             mount-ro |                                       shutdown

          laptop_mode |        default                                

                 root |                          boot                 

                 dbus |        default                                

         termencoding |                          boot                 

        microcode_ctl |                          boot                 

                acpid |        default                                

             netmount |        default                                

               sysctl |                          boot                 

           localmount |                          boot                 

              urandom |                          boot                 

                 udev |                               sysinit         

                 hald |        default                                

       udev-postmount |        default

                 swap |                          boot

               net.lo |                          boot

                 fsck |                          boot

             bootmisc |                          boot

    hibernate-cleanup |                          boot

               procfs |                          boot

                 mtab |                          boot

            alsasound |                          boot

           vixie-cron |        default

            syslog-ng |        default

                local |        default nonetwork

                dmesg |                               sysinit

              modules |                          boot

              hwclock |                          boot

       readahead-list |                          boot

                devfs |                               sysinit

              keymaps |                          boot

          consolefont |                          boot

            savecache |                                       shutdown

             hostname |                          boot

                  xdm |        default

```

Indeed  :Razz:   Swap lives once again now though, so not too fussed I guess...

----------

## Odysseus

 *optiluca wrote:*   

> Hey thanks for your help   I changed a few settings to match your kernel (specifically I emptied the CONFIG_PM_STD_PARTITION="" field, as well as some other settings).  Tuxonice now shows signs of life upon boot, as I see mentions of it appear briefly during bootup.
> 
> Somehow I have lost my swap partition entirely, however....
> 
> swapon /dev/sda7
> ...

 

And Thanks to you, for pointing out the error in my setup. To be honest I don't use an initramfs or framebuffer splash screen so this setting has never been an issue. It is the default TOI configuration and I've never changed it. But now that you pointed it out I'll recompile with it pointing to /sbin/tuxoniceui_text and might play around with it later.

I do use however the default framebuffer without a splash with an Nvidia card. Any time I resume from suspend or hibernate there is a couple of seconds of garbage on the screen until X reinitializes then I get the KDE password screen to unlock the session, and all is good. So the distortions are normal and don't effect anything. So don't worry about it.

I hope this helps.

Ciao,

Odysseus

----------

## optiluca

My distorsions stay for good  :Razz:   All icons / plasmoids become white squares, and logging out and back in seems to be the best way of getting rid of it all...  I guess I will investigate further myself.

Thanks again  :Smile: 

EDIT: I have investigated, and it turns out I only get this problem when suspending via pm-utils.  Hibernate works just fine.  Unfortunately Powerdevil seems to be able to use pm-utils only... :@  Is this true, and if so does anyone have pm-utils + tuxonice + nvidia working successfully?

----------

## poOoch

Same problem here with screen distortion using powerdevil's pm-utils functionality. hibernate-script does work without problems. I'll try a powerdevil downgrade

----------

## poOoch

Downgrading sys-power/pm-utils to version 1.2.5 solves the screen distortion for me.

----------

## optiluca

Ok that fixed it for me as well  :Very Happy:   Now once I get the last few little perks sorted I shall mark this as solved once and for all  :Razz: 

Thanks to all  :Smile: 

----------

## Odysseus

optiluca and poOoch, I didn't notice the issue like you both described because I'm running x86 stable and only use a few ~x86 packages.

Since unstable is where these kind of issues get addressed and since you have both experienced this problem with the latest pm-utils, perhaps you should both file bug reports as this is the only way to get things fixed. 

It only takes a few minutes and contributions like filing these reports is the only way that the maintainers here can find and fix issues, then polish things up before releasing them as stable to the rest of us. Just my 2 cents. TIA.

Ciao,

Odysseus

----------

## poOoch

#303473

----------

## poOoch

Seems to be fixed in pm-utils-1.3.0, everything's fine with this.

----------

