1

I'm trying to install Gentoo on LVM logical volume inside LUKS container encrypted with key file encrypted by GPG with passphrase. Everything was going smoothly until I tried to boot. I'm building the kernel and initramfs with genkernel:

genkernel --lvm --luks --install --menuconfig --busybox all   

and booting it with GRUB2. So after I start the kernel I get the information that my key file gets found, but in the next line I get “Failed to open LUKS device...” and than comes a kernel panic. Any idea what to do?

Kernel config - http://pastebin.com/YR7TfaVm

GRUB2 menuentry:

menuentry 'Gentoo'{
root='hd1,gpt1'
linux /kernel-genkernel-x86_64-3.17.7-gentoo initrd=/dev/ram0 crypt_root=/dev/disk/by-partuuid/PARTUUID_OF_LUKS_CONTAINTER_PARTION dolvm real_root=/dev/mapper/vg1-root rootfstype=ext4 real_init=/usr/lib/systemd/systemd root_keydev=/dev/disk/by-partuuid/PARTUUID_OF_MY_PENDRIVE_WITH_KEY root_key=luks-key.gpg
initrd /initramfs-genkernel-x86_64-3.17.7-gentoo
echo "initing..."
}
  • Any change of seeing the actual error? Did you check if the cyphers you selected for your volume are included in the kernel? (Going trough your .config file would be pointless, we don't know the options you are using for your volume). – Tim Feb 23 '15 at 21:48
  • Are the Disk ID's Correct. Check /etc/fstab to verify. – eyoung100 Mar 2 '15 at 17:28
  • This things were ok. The problem was with new version of gpg that requires pinentry and buggy version of kernel. – Cytadela8 Mar 3 '15 at 8:59
  • @Cytadela8 Please post an answer to your own question and accept it, so it could help others. If there was a (gpg or kernel) bug involved that is now fixed, please consider posting a corresponding link to the issue tracker. – Akater Jun 24 '15 at 4:30
  • Cytadela8, I am writing to you for help on the Gentoo setup procedure. I use the same system scheme (gpg encrypted key-file on usb to encrypt rootfs over lvm with luks). Currently I have compiled kernel. I don't know the next step on 'genkernel' to get initramfs. Also I don't know how to generate the correct grub menu with 'grub2-mkconfig'. Could help a little bit? – Zachary Aug 12 '15 at 13:03
0

My problem got solved after changing kernel version to 3.10 and changing gpg version to an old one, that wasn't requiring pinentry to work and that i compiled statically. Although with new version i checked everything twice there always seemed to be an problem with pinentry. Also I think that genkernel wasn't including pinentry automatically. I had to include it myself.

So to summarize:

  • check if your gpg version requires pinentry (I my case I reverted to an older version to make the initrd)
  • consider more stable kernel version
  • consider compiling gpg statically
  • check all library dependents after generating initrd even if you used something like genkernel
  • gpg is a nasty bit of work. I prefer using cryptsetup to encrypt keyfiles. Why use two encryption programs when you can just use the one? – frostschutz Jun 25 '15 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.