Okay. I have booted up my virtual machine. I’ll just describe how I have it setup.
I should note that I use an encrypted LVM, but that should not make any difference.
1: I have a file “/etc/cr_twleap_lvm” which contains a passphrase.
I’ll note that the name is not critical, as long as there is no conflict. In this case, “twleap” is just the name that I used for the LVM name. I do not use my normal passphrase there. I use a different one, and I then used
cryptsetup luksAddKey device file-path
to make that an additional key. You can use a random number generator for this key if you want.
That file is readable only by root (important).
2: I added that to “/etc/crypttab”. My “crypttab” looks like this:
cr_twleap UUID=e80a722f-877d-4572-a689-03e088c26c7c /etc/cr_twleap_lvm none
3: Force dracut to include that file.
In the directory “/etc/dracut.conf.d”, I created a file “98-crypt.conf”. And note that this file is also set to be readable only by root, though that’s probably not critical.
The file contains the one line:
install_items+=" /etc/cr_twleap_lvm "
The spaces around that path are important.
4: Run “mkinitrd” to rebuild the “initrd”.
And that’s about it. I still have to enter the encryption key before I get the grub boot menu. But, after that, it boots without further prompt for passphrase.
If something goes wrong, then it just prompts for the key anyway.