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'{
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
    Commented Feb 23, 2015 at 21:48
  • Are the Disk ID's Correct. Check /etc/fstab to verify.
    – eyoung100
    Commented Mar 2, 2015 at 17:28
  • This things were ok. The problem was with new version of gpg that requires pinentry and buggy version of kernel.
    – Cytadela8
    Commented Mar 3, 2015 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
    Commented Jun 24, 2015 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
    Commented Aug 12, 2015 at 13:03

1 Answer 1


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? Commented Jun 25, 2015 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .