I'm working on provisioning a server that requires full drive encryption and I want to automate the process of decrypting the drive at startup using the TPM2 module available on the motherboard, but I can't quite get the system to do so.
I have a fresh install of CentOS 9 Stream that was created uing automated LVM partitioning of the only available drive, and it was encrypted as a LUKSv2.
After the installation of the OS, I made sure that clevis
, clevis-luks
, and dracut
were installed. I also installed clevis-systemd
and clevis-udisks2
just in case.
At this stage, running tpm2_pcrread
reported the expected registers.
Then I binded the drive to clevis using the following command:
sudo clevis luks bind -d /dev/<drive> tmp2 '{"pcr_bank":"sha256","pcr_ids":"0,1,7"}'
No issue so far.
I then created a dracut config named tpm2.conf
in /etc/dracut.config.d/
with:
add_dracutmodules+=" clevis clevis-pin-tpm2 crypt tpm2-tss "
install_items+=" /usr/bin/clevis "
hostonly="yes"
Then ran:
sudo dracut -f
At this stage, I thought that was all I needed, but it seems like it wasn't enough.
I then tried to boot with the grub options rd.luks.options=<luks-UUID>=tpm2-device=auto
but that did nothing.
Any idea of what could be the issue?
Thank you