Avoiding to type the passphrase twice for encrypted root file system

I followed the instructions on https://en.opensuse.org/SDB:Encrypted_root_file_system#Avoiding_to_type_the_passphrase_twice, but still I have to type in the passphrase twice.

Is it still supposed to work?

fdisk -l gives me


**Device****    Start****      End****  Sectors**** Size****Type**
/dev/sda1       2048   1050623   1048576  512M EFI System
/dev/sda2    1050624 932186111 931135488  444G Linux filesystem
/dev/sda3  932186112 976773134  44587023 21.3G Linux swap

so I used /dev/sda2 in Step 3.

My /etc/crypttab now looks like this


cr_root  UUID=150ca295-19ba-4088-8fbe-5ea1f4a4d27c  /.root.key  x-initrd.attach
cr_swap  UUID=28b84f3b-1a9f-48fc-af4b-40c51b20c498

I’ve been using Linux for almost 30 years now, so I’m optimistic that I followed the described steps correctly, but still… :slight_smile:
I’m grateful for any hints. Cheers!

Are you using the same encryption key for swap?

If you are, then try changing that second line (of crypttab) to:


cr_swap  UUID=28b84f3b-1a9f-48fc-af4b-40c51b20c498  /.root.key  none

With the “crypttab” you are using, I would expect a prompt for the swap encryption. The prompt message possibly even tells you that.

Hmm, you probably set a second key for your root partition, using that file. You may need to do the same thing for the swap partition.

@nrickert: You rock!

I did Step 3 (cryptsetup) also for the swap partition (/dev/sda3) and changed the crypptab as you suggested and… TADA… it works! lol!
Now that you mentioned the swap partition, I saw the comment right below the steps about “other encrypted partitions”. D’oh!

Thank you so much!

I’m glad to have helped.