For Ubuntu with Full Disk Encryption (LUKS+LVM)
- Prerequisites
- Ubuntu installed with LUKS encryption (passphrase-protected).
- TPM 2.0 enabled in BIOS/UEFI.
- Root/sudo access.
Verify TPM2 is available:
sudo tpm2_getcap properties-fixed | grep "TPM2_PT_MANUFACTURER"- Installation
Install required packages:
sudo clevis luks bind -d /dev/nvme0n1p3 tpm2 '{"pcr_bank":"sha256","pcr_ids":"0,1,2,3,4,5,6,7"}'- Replace
/dev/nvme0n1p3with your LUKS partition (find it vialsblk -f). - Enter your existing LUKS passphrase when prompted.
Verify Binding
sudo clevis luks list -d /dev/nvme0n1p3(Should show a tpm2 binding.)
- Update Initramfs
Rebuild initramfs to include Clevis:
sudo update-initramfs -u -k allVerify Clevis is included:
lsinitramfs /boot/initrd.img-$(uname -r) | grep -i clevis(Should show clevis-decrypt-tpm2 and related files.)
- Reboot and Test
sudo rebootGive a breif wait during the unlock LUKS screen, it should be automatically unlocked.
- when the decryption failed
you can alwasy enter the system with manually inputting the key. when the clevis failed (usually after a ubuntu firmware update). unbind the clevis and bind again.
unbind with
sudo clevis luks unbind -d /dev/nvme0n1p3 -f -s 1
and re-do the steps above again
Using this line to check tpm2 status is more graceful
If it shows TMP error like these
It is very likely a TMP failure caused by a system update. An unbind, then rebind will fix this issue.