Need to setup swap partition automatically if laptop fails to restore from suspend-to-disk

Bug #13808 reported by llpamies
30
Affects Status Importance Assigned to Milestone
Ubuntu
Fix Released
High
Jeff Bailey

Bug Description

My laptop is a Acer TravelMate 4002LMi

I'm using the latest version of hoary, and when I boot, the kernel return me:
(when boot without suspend and suspending)

FATAL: Module suspend_core not found.
FATAL: Module suspend_block_io not found.
FATAL: Module suspend_text not found.
FATAL: Module suspend_lzf not found.
FATAL: Module suspend_swap not found.
Cannot create /proc/software_suspend/do_resume.
[...]
Init ....

My grub configuration is:
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default optons below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda2 resume2=/dev/hda3 vga=792 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Ubuntu, kernel 2.6.10-4-686
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-4-686 root=/dev/hda2 resume2=/dev/hda3
vga=792 ro quiet splash
initrd /boot/initrd.img-2.6.10-4-686
savedefault
boot

title Ubuntu, kernel 2.6.10-4-686 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-4-686 root=/dev/hda2 resume2=/dev/hda3
vga=792 ro single
initrd /boot/initrd.img-2.6.10-4-686
savedefault
boot

title Ubuntu, kernel 2.6.10
root (hd0,1)
kernel /boot/vmlinuz-2.6.10 root=/dev/hda2 resume2=/dev/hda3 vga=792 ro
quiet splash
initrd /boot/initrd.img-2.6.10
savedefault
boot

title Ubuntu, kernel 2.6.10 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.10 root=/dev/hda2 resume2=/dev/hda3 vga=792 ro
single
initrd /boot/initrd.img-2.6.10
savedefault
boot

title Ubuntu, kernel memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

http://lluispamies.net: http://lluispamies.net

Revision history for this message
Jeff Bailey (jbailey) wrote :

Sorry, it's not clear. Did it work before and has stopped working, or has it
simply never worked?

If it stopped working, can you pinpoint when you did the upgrade that caused it
to stop?

Can you please post attach your /var/log/dmesg as an attachment to this bug?

Thanks!

Revision history for this message
llpamies (llpamies-deactivatedaccount) wrote :

Created an attachment (id=1612)
Log file

Revision history for this message
llpamies (llpamies-deactivatedaccount) wrote :

I view this boot errors evry time that I boot my laptop.

I hasn't edited any file, /etc/modules/ or any other file has been edited.

I attach the /var/log/dmsg to this bug.

Revision history for this message
Thomas Schneller (thomas-schneller) wrote :

Seems there is a problem with swap:

> Unable to find swap-space signature

Just check if your swap is propably assigned and mounted.(In reply to comment #0)

Revision history for this message
Jeff Bailey (jbailey) wrote :

As Thomas noted, your swap space isn't set up correctly. You need to run mkswap
on it.

Also, for suspend-to-disk support, you can now put the partition information at
the bottom of /etc/mkinitrd/mkinitrd.conf. At your next kernel re-install it'll
pick that up, and you don't need the stuff in grub's menu.lst

What probably happened here is that you failed to restart the machine correctly
for some reason after suspending. When that happens, the swap signature is left
in a strange state, and needs to be reset. Hmm. I suspect that's the core of
this bug, and have retitled it appropriately. Increasing severity to match, I
think it's major.

Revision history for this message
Thom May (thombot) wrote :

*** Bug 13948 has been marked as a duplicate of this bug. ***

Revision history for this message
Jeff Bailey (jbailey) wrote :

Created an attachment (id=1964)
Patch to checkroot to mkswap over partitions that contain failed resume images

This patch depends on the file bug associated with this one.

Revision history for this message
Jeff Bailey (jbailey) wrote :

Setting target milestone to Ubuntu 5.10. mkswap has almost no sanity checking,
so there is a non-zero risk of dataloss with this patch. This risk is mitigated
by the check for the signature in the partition. This requires a newer version
of file than is currently in Ubuntu.

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

*** Bug 14847 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :

Jeff, can you attach a copy of your proposed code as a standalone shell script,
so that users who experience this bug can test it on their systems and confirm
that it does the right thing?

Revision history for this message
Matt Zimmerman (mdz) wrote :

Can anyone experiencing this bug test the attached patch?

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 16786 has been marked as a duplicate of this bug. ***

Revision history for this message
Vincent Untz (vuntz) wrote :

It doesn't work for me.

Note there is no SWSUSP1 in the output of file:

vuntz@latronche ~/>grep swap /etc/fstab
/dev/hda5 none swap sw 0 0
vuntz@latronche ~/>sudo file -s /dev/hda5
/dev/hda5: data
vuntz@latronche ~/>sudo swapon -a
swapon: /dev/hda5: Invalid argument

Revision history for this message
Matt Zimmerman (mdz) wrote :

The patch requires the Breezy version of file(1); did you try with that?

Revision history for this message
Vincent Untz (vuntz) wrote :

I'm using breezy and, as far as I know, I'm uptodate:

vuntz@latronche ~/>dpkg -S /usr/bin/file
file: /usr/bin/file
vuntz@latronche ~/>dpkg -l file
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé
|/ Err?=(aucune)/H=à garder/besoin Réinstallation/X=les deux (État,Err:
majuscule=mauvais)
||/ Nom Version Description
+++-==============-==============-============================================
ii file 4.12-1 Determines file type using "magic" numbers

Revision history for this message
Jeff Bailey (jbailey) wrote :

http://lkml.org/lkml/2005/9/8/78 is probably the best solution to this, and
minimally invasive.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Sounds reasonable to me; Matthew, what do you think?

Revision history for this message
Matthew Garrett (mjg59) wrote :

I need to put my Bugzilla mails somewhere where I don't accidently miss them.
Yes, that sounds good.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Let's make it so

Revision history for this message
Jeff Bailey (jbailey) wrote :

Solving with util-linux instead, removing dependancy.

Revision history for this message
Jeff Bailey (jbailey) wrote :

Fixed in util-linux 2.12p-6ubuntu5

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.