Re: problem with suspend to disk on linux2.6-t9

From: Rob Landley
Date: Tue Nov 18 2003 - 08:28:33 EST


On Monday 17 November 2003 16:27, dodger wrote:
> hi
> i am using linux2.6-t9 and i am trying to use suspend to disk
> when doing a
> < echo -n "disk" > /sys/power/state >
>
> it is suspending real fine.
> but it is not resuming at all.
> i tried to boot up normally and with resume=/dev/hdb5 ( swap partition )
> but nothing happens...
>
> it just boots up normally...
> i have set /dev/hdb5 as DEFAULT RESUME PARTITION during kernel config...
>
> any ideas?
> thanks

Did you specify a default resume partition (CONFIG_PM_DISK_PARTITION) in your
.config? (Or provide it with the kernel parameter pmdisk=/dev/blah)...

On suspend, it saves to the first mounted swap file. On resume, it hasn't
looked at /etc/fstab yet to see where the swap files are by the time it gets
to resuming, and nobody's bothered to code up any heuristic for what to do
with no default partition, so you have to point it at a partition or it won't
attempt to resume.

Personally, I think that 99% of the time you can just iterate through the
partitions of whatever drive your root device lives on and find the first one
that's got a valid suspend signature on it, and resume from that. (And if
you don't find one, don't resume.) The few cases where this isn't
appropriate can configure another default or supply a kernel command line
paramenter, but having to bake your swap partition location into the kernel
config is a bit klunky at best...

Of course with lilo, there's a user space alternative, you know. Your suspend
script could call lilo -R with a command line that points to the partition
you're about to suspend to. But there are a number of problems with that
(ideally you want to do it right AFTER suspending...) And I dunno if grub's
got an equivalent...

One thing that might be nice is if there was a way to trigger a resume from
the initramfs. "Blow away the current process list and load this binary
image of what userspace should look like." That way figuring out where the
sucker lives is a problem you could punt on. :)

Rob

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/