Help auto mount luks partition root

I deleted the /cryptokeyfile.bin file by mistake
Now, every time I reboot the system, I enter the password of the root partition twice

Does anyone know how I can solve this problem?

The basic steps would be:

  • Remove the old key from your luks volume.(Be careful not to remove your password).
  • Create a new keyfile and add it to the luks volume.
  • Then rebuild your boot images(mkinitcpio/dracut).

How to create keyfile?

Something like this:

dd if=/dev/random bs=32 count=1 of=/cryptokeyfile.bin
1 Like

I created the keyfile and rebooted the system, but I entered the password twice, I think it didn’t work

You can’t just create a new keyfile. You need to remove the old keyfile from your luks volume and then add the new one as I mentioned above.

Unfortunately, I don’t know the steps you mentioned, can you write the instructions commands for the above steps?

I finally found it
7.5.2 With a keyfile embedded in the initramf

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.