Re: Unable to use a keyfile

Milan Broz <[email protected]> Sat, 11 Apr 2026 23:21:43 +0200
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
On 4/11/26 8:50 PM, j4ck32 wrote:
> Hello,
> 
> I have a strange problem with my LUKS setup.
> 
> I can successfully add a keyfile to my LUKS container, but when I try
> to open the container with it the keyfile is rejected.
> I made many attempts with different iterations, but the result is
> always the same.

This should work. Could you try to add "--pbkdf pbkdf2" for luksAddKey?

This will use old PBKDF2 (as in LUKS1) for keyslots.

If it works, I strongly suspect you have issues with hardware.
Specifically if you say "sometimes it works" - this must work always,
it is a deterministic algorithm.

I have seen this several times (note new keyslot use a lot of more memory
that could trigger the issue).

Milan