I have a Debian 8 VPS with an encrypted root partition. After a kernel update a few months ago (package version 3.2.73-2+deb7u3), it stopped being able to decrypt properly on boot. As far as I can tell, the initramfs wasn't loading the crypt libraries, and so didn't know what to do.

I found this answer, but that didn't solve the issues, no matter what UUID we tried. https://unix.stackexchange.com/questions/107810/why-my-encrypted-lvm-volume-luks-device-wont-mount-at-boot-time

Our current kludge that enables us to boot with errors is creating a cryptroot file in /etc/initramfs-tools/conf.d/cryptroot with contents


and an /etc/crypttab with contents

# <target name> <source device>     <key file>  <option>
crypt-vda5  /dev/vda5   none    luks

During boot it asks for the password and mounts vg-root, and then it asks us for the password again and complains that the partition is already mounted, and throws a bunch of errors that I have to hit esc repeatedly to get past. If we remove either one of those files or change them, it doesn't prompt for password on boot, and thus mounting root fails.

Any ideas how to remove the kludge and fix this for good?



It may just work if you add the following to /etc/initramfs-tools/initramfs.conf and move /etc/initramfs-tools/conf.d/cryptroot out of the way.


Then rebuild initramfs, run it with the -k and -v options which will show you what it is doing and whether it adds crypt support. The -k option will keep around the temporary directory mkinitramfs used, which can help in investigating what is going on. Of course keep a copy of the old initramfs around so you can boot that if necessary.

Also /etc/crypttab should contain the logical volume name, if that is vg-root instead of crypt-vda5 make sure to replace it. That name is the string example-name used in the following:

cryptsetup -v luksOpen /dev/vda5 example-name

Which should be accessible under:

  • I'm afraid that didn't work. I edited /etc/crypttab to crypt-vda5 /dev/cloud--vg-root none luks and then got the error: Volume group "cloud-vg" not found Skipping volume group cloud-vg Unable to find LVM volume cloud-vg/root – mxroo Jul 13 '16 at 1:52
  • I'm pretty sure the thing I didn't have clear to myself earlier is that there is a device /dev/vda5 which is encrypted. The LVM, which contains cloud--vg-root, is on that device. – mxroo Jul 13 '16 at 1:54

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.