Add the key file to LUKS

I read

cat /etc/crypttab
cr-auto-1  UUID=38298dab-1163-4bb6-8aba-6df3ea9dca16  none  x-initrd.attach

The webpage says add the key file in the third column, I don’t know what is exactly like and here is my modified.

cr-auto-1  UUID=38298dab-1163-4bb6-8aba-6df3ea9dca16  cr_sda1 UUID=38298dab-1163-4bb6-8aba-6df3ea9dca16 /.root.key  x-initrd.attach

Perhaps it is wrong and looks strange, what it would be like?

The third field specifies an absolute path to a file with the encryption key.

The wiki page you reference shows you example of crypttab line with the third column containing absolute path of file with the encryption key. What is not clear in this example?


cr-auto-1  UUID=38298dab-1163-4bb6-8aba-6df3ea9dca16      /.root.key  x-initrd.attach

Add the text in the new line or replace the original line with the text? Because the operations are about booting system or partition, if I made something wrong broken my boot, can I have a way to rescue or rollback my system to original?

Replace the line that you had.

Then run “mkinitrd” (as root, of course). Then see if it works.