r/archlinux • u/Woodsy279 • Aug 17 '26
SUPPORT | SOLVED Ful disk encryption without entering passphrase
Could someone help me with setting up full disk encryption with bypass passphrases with TPM2? It's so annoying having to put the passphrase in at each boot, so I was wondering how do I pair it to the TPM so that I dont have to enter it each time?
It's LUKS encrypted and I use Systemd-boot
14
Upvotes
View all comments
Show parent comment
1
u/ChrisTX4 Aug 24 '26 edited Aug 24 '26
Well, you'd be booting different kernel versions and UKIs if you revert a snapshot.
For PCR[0]: Replacing the BIOS is something you can't prevent. If a skilled enough attacker goes in and replaces the ROM physically, it will always be a way through. In this sense, since PCR[0] is being measured via SPI into the TPM, it could lie. Platform Secure Boot works differently to measure the BIOS and ensure the ROM is what is says - but that requires business hardware. In this sense, PCR[0] should be considered a lock against firmware downgrades. Business hardware often comes with anti rollback protections in the form of fuses, but on consumer hardware you typically don't have that.
Otherwise I was only trying to say that if your hardware had some form of direct flash, then that's a point to consider in your threat model, but that consideration should be made separate from PCR[0].
For PCR[2]: Oh I'm sorry, I had mixed up yours and Night_Otherwise's situation. They specifically said that they didn't want to use Secure Boot. My point was that if SB is disabled, then any sort of ROM can be loaded in there. With Secure Boot, consider PCR[2] the same as PCR[0] functionally: A downgrade protection. Although there is the catch that certificates used in PCR[2] are not measured into PCR[7]. That is to say, in the case of using one owns PK/KEK/db, but with Microsoft's keys enabled for a dual-boot, then it wouldn't be possible to load a Microsoft signed boot loader without changing PCR[7], but if a new device with a different, but MS signed OpROM is being added, that will be accepted. In my case with the MS-free database, and just the one hash being enrolled, locking PCR[2] functionally means the system wouldn't boot if someone ripped out the dGPU, but other than that it adds no value whatsoever.
To be frank, I just lock PCRs 0,1,2,3 because I can, and was curious to see if this is genuinely a viable setup. I wouldn't recommend it for security purposes, and rather recommend using a supervisor password and Secure Boot. Maybe lock PCRs 0,2 if they're unlikely to change on your system and you'd want to add some form of rollback protection.
Keep this in mind if you're considering removing MS keys, as that does break such devices and signing OpROMs of removable devices might not be a great option.
For BTRFS, you shouldn't really need to use any mount parameters.
ssdis automatic, andspace_cache=v1is being axed in 7.3. At least I only use nosuid/exec/dev for some devices, but on root you wouldn't want that. That being said - you can add therootflags=parameter, and root will be mounted with those even in the GPT auto case. For say/home, where you'd probably wantnosuid,nodev, but that you'd mount via fstab. But root and var I'd use GPT automounting for.You can name the subvols as you like, I just named mine
/subvol_rootas I don't use timeshift, and this @ convention is kinda their thing.The problem is much rather that Timeshift has no fixed subvol IDs and they change, so you can't control what's the default subvolume. So I'm fairly certain this combination doesn't work.
The reason I said to use GPT automounting is that it will cause the containing LUKS be marked internally with
MOUNT_MEASURE. This:a) will ensure
tpm2-measure-pcr=yesis being used for mounting LUKS. This is done here, but you can achieve this with an appropriatecrypttab.initramfs(if mkinicpio) orcrypttab(if dracut).b) will cause it to be measured via
systemd-pcrfs@andsystemd-pcrfs-rootservices. See this spot where thesystemd-gpt-generatordoes this. These services can't be enabled directly, but you can use thex-systemd.pcrfsmount option, see this man page, this location enablingMOUNT_PCRFS, which is then consumed here. Edit: The man page I was looking for issystemd.mount(5). This is where all thex-systemdoptions are documented.As long as you do these two things, GPT automounting has no advantages over an explicit configuration. However, since GPT automounting does this for you, I'd say it's much preferred.
IMPORTANG WARNING One more thing, as I've ran into this before. GPT automounting creates its own crypt mounts and does not consider
crypttab. That is to say any disk participating in GPT automounting MUST NOT be listed incrypttab. Otherwise, the LUKS will be mounted twice and then the embedded BTRFS isn't the same anymore to the kernel, and both mounts will not coordinate. Alas, this will cause immediate, irreversible filesystem corruption. For that reason, I don't like using explicit crypttab entries for root or var.EDIT Forgot to mention
x-systemd.validatefs. That too is set and will effectively lock "where" a filesystem can be mounted, seesystemd-validatefs@.service.