DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: yumkam@gmail.com (Yuriy M. Kaminskiy)
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile.
Date: Wed, 30 Mar 2016 00:04:36 +0300	[thread overview]
Message-ID: <m360w5t2qj.fsf@gmail.com> (raw)
In-Reply-To: CAPMKG4DRtPyxbXFBWHaYZGHuB87ghT2QfXoWJ0Hhb172pp+K9g@mail.gmail.com

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

  reply	other threads:[~2016-03-29 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-03-30  5:51   ` Milan Broz
2016-03-31 19:53     ` Nicolas Bock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m360w5t2qj.fsf@gmail.com \
    --to=yumkam@gmail.com \
    --cc=dm-crypt@saout.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox