You are not logged in.

#1 2022-01-17 19:01:22

HoltFrak
Member
Registered: 2022-01-16
Posts: 7

[SOLVED]Cannot open newly-created luks partition with keyfile

Hi all,

I'm on a fresh Arch installation. My boot, root and home partitions are on one encrypted drive (opened with a passphrase), and I'm trying to add two other encrypted drives to be mounted in my /home/user directory that are to be opened with a keyfile on the drive I'm writing this from. I'm formatting them according to the Arch Wiki page on dm-crypt:

# cryptsetup luksFormat device /path/to/mykeyfile

However, when I try to open the volumes I'm prompted for a passphrase. To my knowledge, there is no passphrase associated with this volume, as I was not prompted for one on its creation. I've done some googling but I cannot track down something specific to a newly-created luks partition not using its assigned keyfile.

I've done something similar on my last Arch installation, but it was with passphrases so the system required two passphrases on boot, which was inelegant at best. Obviously I'm missing something, but I don't know what.

Last edited by HoltFrak (2022-01-18 00:39:28)

Offline

#2 2022-01-17 19:51:19

frostschutz
Member
Registered: 2013-11-15
Posts: 1,649

Re: [SOLVED]Cannot open newly-created luks partition with keyfile

The LUKS header (metadata) only has key slots, it does not differentiate between passphrases (entered by keyboard), standard input (key data provided through a pipe), or key files.

Thus if you run cryptsetup open without additional parameters, it will always prompt for a passphrase even if it cannot be unlocked via keyboard (if your keyfile had random data instead of ascii).

You have to use cryptsetup open --key-file /path/to/file or similar to avoid the passphrase prompt.

Offline

#3 2022-01-17 23:36:08

HoltFrak
Member
Registered: 2022-01-16
Posts: 7

Re: [SOLVED]Cannot open newly-created luks partition with keyfile

Ugh. Of course it's something obvious. Thanks for your help!

Offline

Board footer

Powered by FluxBB