This is a way I enter a new passphrase for my encrypted volume:
sudo cryptsetup luksAddKey --key-slot 4 /dev/sda5
cryptsetup does not ask to confirm the new passphrase. How to make sure that the passphrase I have entered is the one that I actually meant?
I see two workarounds.
- Reboot and try the new passphrase.
- Add a temporary passphrase to another slot with the help of the new passphrase. Kill the temporary passphrase.
Is there a more elegant way?