View Full Version : Fixing broken hibernate after kernel updates in f19

18th November 2013, 12:47 PM
I recently made a pretty-much-vanilla fresh install of f19 from the full DVD, and hibernate worked fine straight out of the box. However the first batch of updates broke it, with the kernel complaining "PM: cannot find swap device".

I've searched on here and t'internet in general but only found references to swap space being insufficient, and this was not the problem.

In the end I found that the new grub menu generated when I installed the kernel update lacked the parameter to inform the kernel of where to suspend to (even on the entries for the old kernel), which I suppose was hard-coded in the menu that came on the DVD. In order to fix:

edit /etc/grub.d/10_linux

find the line

linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}

and change it to

linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} resume=`swapon -s | grep '/dev/dm.[0-9]' -o`

in my case I am using LVM (as this is the default on installation) but if your swap partition is elsewhere then change the '/dev/dm.[0-9]' to '/dev/sd.[0-9]'

After you've made this edit, backup your old grub menu and generate a new one using the grub utils:

cp /boot/grub2/grub.cfg /boot/grub2/grub.old
grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot and you should be away.

Hope this helps someone, I can't be the only person who has experienced this!


---------- Post added at 11:47 AM ---------- Previous post was at 11:45 AM ----------

I should probably add links to the references I ended up using to fix things, although their instructions don't apply exactly to f19.

ArchWiki suspend and hibernate:

Debian Wiki configuring GRUB: