All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile.
@ 2016-03-28  5:16 Nicolas Bock
  2016-03-29 21:04 ` Yuriy M. Kaminskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Bock @ 2016-03-28  5:16 UTC (permalink / raw)
  To: dm-crypt

Hi,

cryptsetup fails on a new OS install for some reason, and I can't
figure out what is missing. What I see is the following:

$ dd if=/dev/zero bs=1M count=1 of=cryptfile
$ sudo cryptsetup -v luksFormat cryptfile

WARNING!
========
This will overwrite data on cryptfile irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
Failed to setup dm-crypt key mapping for device cryptfile.
Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
Command failed with code 22: Failed to setup dm-crypt key mapping for
device cryptfile.
Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).

Neither dmesg nor journalctl shows anything in the logs that seems to
be related to this failure. As far as I can tell all cryptographic API
modules are included in the kernel. How can I go about debugging this
further?

Thanks already,

Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile.
  2016-03-28  5:16 [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile Nicolas Bock
@ 2016-03-29 21:04 ` Yuriy M. Kaminskiy
  2016-03-30  5:51   ` Milan Broz
  0 siblings, 1 reply; 4+ messages in thread
From: Yuriy M. Kaminskiy @ 2016-03-29 21:04 UTC (permalink / raw)
  To: dm-crypt

Nicolas Bock <nicolasbock@gmail.com>
writes:

> cryptsetup fails on a new OS install for some reason, and I can't
> figure out what is missing. What I see is the following:
>
> $ dd if=/dev/zero bs=1M count=1 of=cryptfile
> $ sudo cryptsetup -v luksFormat cryptfile
>
> WARNING!
> ========
> This will overwrite data on cryptfile irrevocably.
>
> Are you sure? (Type uppercase yes): YES
> Enter passphrase:
> Verify passphrase:
> Failed to setup dm-crypt key mapping for device cryptfile.
                                       ^^^^^^^^^^
> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
> Command failed with code 22: Failed to setup dm-crypt key mapping for
> device cryptfile.
  ^^^^^^
> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
>
> Neither dmesg nor journalctl shows anything in the logs that seems to
> be related to this failure. As far as I can tell all cryptographic API
> modules are included in the kernel. How can I go about debugging this
> further?

I'd guess it wants block device, instead of file. man 8 losetup.
Something like this (unchecked):

  loopdev=`losetup --find --show cryptfile`
  cryptsetup -v luksFormat $loopdev
  cryptsetup luksOpen $loopdev cryptfile-container
  ...
  cryptsetup luksClose cryptfile-container
  losetup --detach $loopdev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile.
  2016-03-29 21:04 ` Yuriy M. Kaminskiy
@ 2016-03-30  5:51   ` Milan Broz
  2016-03-31 19:53     ` Nicolas Bock
  0 siblings, 1 reply; 4+ messages in thread
From: Milan Broz @ 2016-03-30  5:51 UTC (permalink / raw)
  To: dm-crypt


On 03/29/2016 11:04 PM, Yuriy M. Kaminskiy wrote:
> Nicolas Bock <nicolasbock@gmail.com>
> writes:
> 
>> cryptsetup fails on a new OS install for some reason, and I can't
>> figure out what is missing. What I see is the following:

What version are you using?

>>
>> $ dd if=/dev/zero bs=1M count=1 of=cryptfile
>> $ sudo cryptsetup -v luksFormat cryptfile
...
cryptsetup -v luksFormat cryptfile --use-urandom

WARNING!
========
This will overwrite data on cryptfile irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase: 
Verify passphrase: 
Device cryptfile is too small. (LUKS requires at least 1049600 bytes.)
Command failed with code 22: Device cryptfile is too small. (LUKS requires at least 1049600 bytes.)

That is pretty clear error message :)

Just use bigger image.

>>
>> WARNING!
>> ========
>> This will overwrite data on cryptfile irrevocably.
>>
>> Are you sure? (Type uppercase yes): YES
>> Enter passphrase:
>> Verify passphrase:
>> Failed to setup dm-crypt key mapping for device cryptfile.
>                                        ^^^^^^^^^^
>> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
>> Command failed with code 22: Failed to setup dm-crypt key mapping for
>> device cryptfile.
>   ^^^^^^
>> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
>>
>> Neither dmesg nor journalctl shows anything in the logs that seems to
>> be related to this failure. As far as I can tell all cryptographic API
>> modules are included in the kernel. How can I go about debugging this
>> further?

1) use newer version of cryptsetup
2) always report versions (cryptsetup, kernel), distro
3) paste debug log (add --debug to failing commands, it includes 2) as well)
 
> 
> I'd guess it wants block device, instead of file. man 8 losetup.
> Something like this (unchecked):

Loop is automatically allocated in recent versions of cryptsetup, you can
use file image directly (no need dance with losetup).
Milan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile.
  2016-03-30  5:51   ` Milan Broz
@ 2016-03-31 19:53     ` Nicolas Bock
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Bock @ 2016-03-31 19:53 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

Sorry for the lack of details in my first email. I have bisected this
a bit more and upgrading to version 1.7.1 fixed the problem for me. I
am using kernel 3.18.29 for reference. Thanks for the help!

Nick


On Wed, Mar 30, 2016 at 7:51 AM, Milan Broz <gmazyland@gmail.com> wrote:
>
> On 03/29/2016 11:04 PM, Yuriy M. Kaminskiy wrote:
>> Nicolas Bock <nicolasbock@gmail.com>
>> writes:
>>
>>> cryptsetup fails on a new OS install for some reason, and I can't
>>> figure out what is missing. What I see is the following:
>
> What version are you using?
>
>>>
>>> $ dd if=/dev/zero bs=1M count=1 of=cryptfile
>>> $ sudo cryptsetup -v luksFormat cryptfile
> ...
> cryptsetup -v luksFormat cryptfile --use-urandom
>
> WARNING!
> ========
> This will overwrite data on cryptfile irrevocably.
>
> Are you sure? (Type uppercase yes): YES
> Enter passphrase:
> Verify passphrase:
> Device cryptfile is too small. (LUKS requires at least 1049600 bytes.)
> Command failed with code 22: Device cryptfile is too small. (LUKS requires at least 1049600 bytes.)
>
> That is pretty clear error message :)
>
> Just use bigger image.
>
>>>
>>> WARNING!
>>> ========
>>> This will overwrite data on cryptfile irrevocably.
>>>
>>> Are you sure? (Type uppercase yes): YES
>>> Enter passphrase:
>>> Verify passphrase:
>>> Failed to setup dm-crypt key mapping for device cryptfile.
>>                                        ^^^^^^^^^^
>>> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
>>> Command failed with code 22: Failed to setup dm-crypt key mapping for
>>> device cryptfile.
>>   ^^^^^^
>>> Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
>>>
>>> Neither dmesg nor journalctl shows anything in the logs that seems to
>>> be related to this failure. As far as I can tell all cryptographic API
>>> modules are included in the kernel. How can I go about debugging this
>>> further?
>
> 1) use newer version of cryptsetup
> 2) always report versions (cryptsetup, kernel), distro
> 3) paste debug log (add --debug to failing commands, it includes 2) as well)
>
>>
>> I'd guess it wants block device, instead of file. man 8 losetup.
>> Something like this (unchecked):
>
> Loop is automatically allocated in recent versions of cryptsetup, you can
> use file image directly (no need dance with losetup).
> Milan
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-31 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-28  5:16 [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile Nicolas Bock
2016-03-29 21:04 ` Yuriy M. Kaminskiy
2016-03-30  5:51   ` Milan Broz
2016-03-31 19:53     ` Nicolas Bock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.