Breaking and Fixing Hibernate in Ubuntu
Hibernation broke on my Ubuntu laptop/netbook last night; almost certainly my fault; fixed this morning.
A Little History
Installed Jaunty on my Gateway/Packard-Bell laptop/netbook — hibernation is fine. Upgraded to Karmic Beta — hibernation is fine.
My Ubuntu installation uses as simple partition layout: swap plus everything else in one partion, as I was too lazy to do it properly. Mistake! I wanted to move from ext3 to ext4, so I need to unmount the everything filesystem to tunefs and e2fsck it (see the ext4 HOW-TO for details). I had no USB CD/DVD drive to hand, and did not want to re-image my USB stick, so I installed a second, minimal, copy of Karmic in a spare partition, booted from that, mounted the filesystem of my main installation, ext4ised it and booted back into said installation — fine?
Hibernate was broken. First up, used the already-existing swap partition for the second, minimal Karmic — idiot! That changed the UUID, so the swap on the main install had broken. Use blkid to find the new UUID, fix up the /etc/swap and /etc/initramfs-tools/conf.d/resume, then dpkg-reconfigure initramfs-tools. Bad words; still not working.
Aha! The resume entries have disappeared from /boot/grub/grub.cfg, the GRUB2 equivalent of menu.lst. grub.cfg is auto-generated by grub-mkconfig from stuff in /boot, /etc/grub.d and /etc/defaults/grub. Being too lazy to poke through all that, I simply fixed up the grub.cfg file with an appropriate resume argument
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=8a62d407-cad0-4d5c-939b-338c6030af32 resume=UUID=87cf94fa-c7c6-47a5-9d4d-662379ad7724 ro quiet splashi.e., the UUID of the swap/resume partition. Done.