From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Wed, 30 Mar 2016 07:51:30 +0200 (CEST) Received: by mail-wm0-x22a.google.com with SMTP id r72so83857815wmg.0 for ; Tue, 29 Mar 2016 22:51:29 -0700 (PDT) Received: from [10.34.26.80] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id i5sm2058330wjx.15.2016.03.29.22.51.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 22:51:28 -0700 (PDT) References: From: Milan Broz Message-ID: <56FB695E.3080703@gmail.com> Date: Wed, 30 Mar 2016 07:51:26 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] Failed to setup dm-crypt key mapping for device cryptfile. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 03/29/2016 11:04 PM, Yuriy M. Kaminskiy wrote: > Nicolas Bock > 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