Sunday 25 July 2010

Resume from encrypted swap in Fedora 13 (solved)

Problem: Install Fedora 13 with / and swap on encrypted partitions. Hibernate appears to work, but resume does not: it asks for password and then carries on with normal boot.

Fix: the kernel boot parameters need to include
  • resume=UUID=(uuid of file system device supporting the encrypted swap)
Although Fedora's installer easily and nicely sets up the encrypted partitions, and adds lvm- and luks-related activation parameters to the kernel stanza in grub, it does not add the resume= parameter.

Initially I tried
  • resume=/dev/mapper/swap0
which seemed reasonable, since root=/dev/mapper/luks-whatever is automatically added by anaconda.
However, that doesn't work: the resume boot fails, with a message like "Could not open root filesystem", and it sleeps forever.

Here is an example from a working /boot/grub/menu.lst:

# names and UUIDs
#
#root luks luks-fe45fa34-fbcc-4b0e-e556-3cb453e454f5

#root lv vg_lex/LogVol01
#root /dev/mapper/luks-
fe45fa34-fbcc-4b0e-e556-3cb453e454f5

#swap luks luks-23d23dea-8732-42d2-c319-4568973a74373
#swap lv vg_main/LogVol00
#swap /dev/mapper/swap0
#swap Filesystem 34deffd5-2328-4702-45e5-4532a1fd45e2

# failed:
# resume=/dev/mapper/swap0
# ok:
# resume=UUID=
34deffd5-2328-4702-45e5-4532a1fd45e2

title Fedora (2.6.33.6-147.fc13.i686.PAE)
root (hd0,5)
kernel /vmlinuz-2.6.33.6-147.fc13.i686.PAE ro root=/dev/mapper/
luks-fe45fa34-fbcc-4b0e-e556-3cb453e454f5 rd_LUKS_UUID=luks-fe45fa34-fbcc-4b0e-e556-3cb453e454f5 rd_LVM_LV=vg_main/LogVol01 rd_LUKS_UUID=luks-23d23dea-8732-42d2-c319-4568973a74373 rd_LVM_LV=vg_main/LogVol00 rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb resume=UUID=34deffd5-2328-4702-45e5-4532a1fd45e2 quiet
initrd /initramfs-2.6.33.6-147.fc13.i686.PAE.img


No comments:

Post a Comment