You are not logged in.

#1 2008-08-22 18:34:25

cjpembo
Member
Registered: 2008-08-06
Posts: 105

[SOLVED] s2ram works, s2disk is close to working

I installed uswsusp using yaourt -S uswsusp.

Suspend to ram (s2ram) works "out of the box" (all intel hardware, so I'm lucky).

I am close to getting s2disk working by following the Suspend to Disk wiki (http://wiki.archlinux.org/index.php/Suspend_to_Disk).  I'm attempting the "Uswsusp Method" detailed in the wiki. 

I edited /etc/suspend.conf and added my swap partition:
resume device = /dev/sda3
and I enabled compression:
compress = y

When I issue s2ram, the ram image is created, compressed, and stored on the swap partition.  The machine powers off.  When I power back on, my machine boots like normal.  It does not use the saved state from the swap file.  It shows an error when trying to mount the swap file however.  So, how do I get it to restore from the disk?  I use lilo if that matters.

Thanks,

Chris

Last edited by cjpembo (2008-08-22 20:16:06)

Offline

#2 2008-08-22 18:41:48

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

Did you change the /etc/mkinitcpio.conf file and regenerate the kernel boot image, like the good wiki says ("Recreate the intramfs" section)?

Last edited by fwojciec (2008-08-22 18:42:15)

Offline

#3 2008-08-22 18:53:11

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

Yes, I forgot to mention that I performed that step.  I believe the restore image is being created correctly, but I don't know how to make my machine use it when it wakes up.

Offline

#4 2008-08-22 18:58:23

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

If the mkinitcpio "uresume" hook is set correctly mkinitcpio.conf, and the image was regenerated to include it after you made the change to the mkinitcpio config file, the image should be read.  Without it, the boot up routine will never even look for it.

My guess is that the problem has something to do with the cpio image...  Other than that, I've no idea what could be causing this.

EDIT: Also, double-make-sure that the uresume hook is in the correct location, that is after the udev hook and immediately before the filesystems hook.

Last edited by fwojciec (2008-08-22 19:01:53)

Offline

#5 2008-08-22 19:11:29

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: [SOLVED] s2ram works, s2disk is close to working

May I suggest TuxOnIce? It has always worked flawlessly for me.


Arch - It's something refreshing

Offline

#6 2008-08-22 19:15:58

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

I think I found the problem:   the wiki is not clear that you add the resume hook when using the Uswsusp method; it mentions it later, in the section detailing with the Tuxonice routine.  I sure if I add the resume hook using the s2disk method, it should work.  Do I need to add the same kernel parameter to my lilo.conf that is added to grub.conf:

resume=swap:/dev/sda3

What if starting normally: will the resume kernel parameter be ignored?

Offline

#7 2008-08-22 19:19:13

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

If I remember correctly the uswsusp method needs no kernel parameters (since it's a userspace method), you do need the resume= kernel parameter if you're using pm-suspend, tuxonice (is it resume2= or did they change that?) and the generic kernel method.

Offline

#8 2008-08-22 19:40:27

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

Now the default kernel wont load and gives the following:

ACPI: Aborted because bad gzip magic numbers.
Kernel panic - not syncing: bad gzip magic numbers

This is after adding the resume hook and running:

mkinitcpio -k `uname -r` -g /boot/kernel26.img

The fallback kernel image works.

Any ideas?

Chris

Offline

#9 2008-08-22 19:43:51

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

No idea, I've never seen an error like this...
You should be able to fix it by removing the uresume hook and regenerating the cpio image again.

Is there any particular reason why you're decided on the uswsusp method?  You could try pm-utils instead, for example.

Offline

#10 2008-08-22 19:47:17

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

You keep saying use a "uresume" hook and the wiki say a "resume" hook.  Which is correct?

Offline

#11 2008-08-22 19:50:06

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

"uresume" for uswsusp, "resume" for other methods.  The wiki, for uswsusp, says "uresume" (in the section I mentioned).

Offline

#12 2008-08-22 19:56:20

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

Ok, I got it to work.

The wiki needs to say "uresume" hook, not "resume" hook.  Then I ran "lilo" after I updated the init image: perhaps that is necessary too?  I've never been too good at mkinitcpio ...

Thanks everyone.

Chris

Offline

#13 2008-08-22 19:59:01

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

Don't blame the wiki wink

wiki wrote:

Recreate the intramfs

Now you need to recreate an initramfs with the new hook. So edit the /etc/mkinitcpio.conf file. In the HOOKS list add the uresume hook (it is different from the resume hook, which is on the contrary required by the tuxonice method). You should put it immediately before the filesystem hook. When the hook is executed the device file for the swap partition (which you have defined in /etc/suspend.conf) needs to exist (the standard udev hook will take care of this). Now proceed to regenerate your initramfs :

I guess you were trying to configure uswsusp using the instruction for tuxonice and others...

Offline

#14 2008-08-22 19:59:30

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

No, you are right: it does say uresume.  I need glasses!

Offline

#15 2008-08-22 20:02:43

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

I added some boldface to the relevant section in the wiki so it is easier to read.

Offline

#16 2008-08-22 20:07:44

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: [SOLVED] s2ram works, s2disk is close to working

I am using the lilo boot manager: do you need to update lilo after running mkinitcpio?  I did, but I'm not sure if it is required?

Offline

#17 2008-08-22 20:08:52

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: [SOLVED] s2ram works, s2disk is close to working

No idea, I've never used lilo, but I guess it updating it won't hurt.

Offline

Board footer

Powered by FluxBB