Skip to content

Commit bfc8114

Browse files
committed
gentoo-config-luks2-grub-systemd: Restore cryptsetup cmdline options
Fixes: bf04afc (gentoo-config-luks2-grub-systemd: Update for GRUB 2.14, 2026-05-19)
1 parent b811037 commit bfc8114

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

content/en/collections/gentoo-config-luks2-grub-systemd/setup-process/tune-parameters.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ could cost GRUB half a minute due to those factors' absence.
135135

136136
## Change the Parameters
137137

138+
The parameters that affect the unlock speed the most are applied on a per-key
139+
slot basis rather than on the entire LUKS partition, so they need to be changed
140+
individually for each key slot.
141+
138142
`cryptsetup luksConvertKey` can be used to update a key slot's parameters. If
139143
the `--key-file` option is *not* included in its invocation, then `cryptsetup`
140144
asks for the passphrase and applies the new settings to any key slot that can
@@ -147,14 +151,21 @@ these ones for updating a key slot's parameters:
147151
- `--pbkdf-force-iterations`: The new time cost for the key slot
148152
- `--pbkdf-memory`: The new memory requirement for the key slot
149153

150-
The following commands set the number of iterations (i.e. time cost) to 4 and
154+
The commands below set the number of iterations (i.e. time cost) to 4 and
151155
memory requirement to 400 MiB, which, at least on a quad-core Intel Core
152156
i5-1135G7 dated from 2020, allow the LUKS partition to be unlocked in about 2
153-
seconds from GRUB 2.14 and should still grant reasonable security:
157+
seconds from GRUB 2.14 and should still grant reasonable security. Note that
158+
customized encryption parameters (like `--pbkdf` and `--hash` in previous
159+
sections) must be explicitly specified again in the commands, or else
160+
`cryptsetup` would reset them to their default values.
154161

155162
```console
156-
# cryptsetup luksConvertKey /dev/sda2 --pbkdf-force-iterations 4 --pbkdf-memory 409600
157-
# cryptsetup luksConvertKey /dev/sda2 --pbkdf-force-iterations 4 --pbkdf-memory 409600 --key-file /etc/cryptsetup-keys.d/gentoo.key
163+
# cryptsetup luksConvertKey /dev/sda2 \
164+
--pbkdf argon2id --hash sha512 \
165+
--pbkdf-force-iterations 4 --pbkdf-memory 409600
166+
# cryptsetup luksConvertKey /dev/sda2 \
167+
--pbkdf argon2id --hash sha512 \
168+
--pbkdf-force-iterations 4 --pbkdf-memory 409600 --key-file /etc/cryptsetup-keys.d/gentoo.key
158169
```
159170

160171
These commands update the parameters for both key slots together. Although

0 commit comments

Comments
 (0)