generated from brckd/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(tpm-disk-unlock): separate from secure boot
- Loading branch information
Showing
3 changed files
with
71 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: TPM disk unlock | ||
description: Learn how to set up TPM disk unlock on NixOS. | ||
--- | ||
|
||
import { Aside, Steps, Tabs, TabItem } from "@astrojs/starlight/components"; | ||
|
||
<Aside> | ||
This guide assumes that you have set up [secure boot](./secure-boot). | ||
</Aside> | ||
|
||
## Setup | ||
|
||
With secure boot in place, TPM can be used to automatically unlock encrypted | ||
partitions. After enabling this feature in the BIOS, setup your partitions. For | ||
each encrypted partition, setup disk unlock by replacing `<encrypted-partion>` | ||
with its identifier, e.g. `nvme0n1p1`, `sda1` or `disk/by-label/NIXOS`. | ||
|
||
<Tabs syncKey="nix-environment"> | ||
<TabItem label="NixOS"> | ||
|
||
```sh "<encrypted-partition>" | ||
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+7+12 /dev/<encrypted-partition> | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Troubleshooting | ||
|
||
### Outdated TPM disk unlock | ||
|
||
After an OS or UEFI update using TPM disk unlock, the disks may not be | ||
automatically unlocked and you will be prompted for the encryption password on | ||
boot. The following steps might resolve this issue. | ||
|
||
<Steps> | ||
<ol> | ||
<li> | ||
|
||
For each encrypted partition, remove disk unlock by replacing | ||
`<encrypted-partion>` with its identifier, e.g. `nvme0n1p1`, `sda1` or | ||
`disk/by-label/NIXOS`. | ||
|
||
<Tabs syncKey="nix-environment"> | ||
<TabItem label="NixOS"> | ||
|
||
```sh | ||
sudo systemd-cryptenroll --wipe-slot tpm2 /dev/<encrypted-partition> | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
</li> | ||
<li> | ||
|
||
[Setup TPM disk unlock](#tpm-disk-unlock) again. | ||
|
||
</li> | ||
</ol> | ||
</Steps> | ||
|
||
## Further reading | ||
|
||
- [TPM disk unlock](https://jnsgr.uk/2024/04/nixos-secure-boot-tpm-fde/#tpm-unlock-of-root-partition) | ||
on Nix |