From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mail.saout.de (Postfix) with ESMTP for ; Sat, 21 May 2011 21:01:02 +0200 (CEST) Received: from b.earth.lavabit.com (b.earth.lavabit.com [192.168.111.11]) by karen.lavabit.com (Postfix) with ESMTP id 63B4D11BB15 for ; Sat, 21 May 2011 13:33:06 -0500 (CDT) Received: from 10.0.0.2 (109.169.23.181) by lavabit.com with ESMTP id 8VMFVTPS061N for ; Sat, 21 May 2011 13:33:06 -0500 From: dhvvcb@lavabit.com Content-Type: text/plain; charset="UTF-8" Date: Sun, 22 May 2011 00:40:36 +0600 Message-Id: <1306003236.10131.75.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [dm-crypt] Using dmsetup directly instead of cryptsetup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de Usually I run command cryptsetup -d /path/to/key -c aes-cbc-essiv:sha256 -s 256 create hdd2 /dev/sdc and /dev/mapper/hdd2 is created. I tried to follow the example given on home page http://www.saout.de/misc/dm-crypt/ echo 0 crypt | dmsetup create name where is a hexadecimal representation of the binary key. As a result, /dev/mapper/name should be created. To create /dev/mapper/hdd2 corresponding to /dev/sdc I run the commands: echo 0 $(blockdev --getsz /dev/sdc) crypt aes-cbc-essiv:sha256 "$(cat /path/to/key.hex)" 0 /dev/sdc 0 | dmsetup create hdd2 Here '/path/to/key.hex' is the hexadecimal representation of binary '/path/to/key'. I converted 'key' to 'key.hex' with the help of hexdump. Size of 'key.hex' file (65B) is twice as large as binary 'key' (32B) because each binary symbol is determined by two hexadecimal numbers. However this /dev/mapper/hdd2 can not be mounted. While /dev/mapper/hdd2 created with cryptsetup is mounted. So straightforward dmsetup usage and cryptsetup create different /dev/mapper/hdd2, though key is the same. The question is how to use dmsetup straightforward so as it would give the same encrypted device as cryptsetup does.