From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A9VJAR4P5P8S for ; Sat, 29 Jun 2013 10:48:34 +0200 (CEST) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Sat, 29 Jun 2013 10:48:34 +0200 (CEST) Received: by mail-we0-f182.google.com with SMTP id p60so1902300wes.13 for ; Sat, 29 Jun 2013 01:48:33 -0700 (PDT) Message-ID: <51CE9F20.1020802@gmail.com> Date: Sat, 29 Jun 2013 10:47:28 +0200 From: Milan Broz MIME-Version: 1.0 References: <1372476079.12711.8.camel@heisenberg.scientia.net> In-Reply-To: <1372476079.12711.8.camel@heisenberg.scientia.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] cryptsetup alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Anton Mitterer Cc: dm-crypt@saout.de On 29.6.2013 5:21, Christoph Anton Mitterer wrote: > Hi Milan, et al. > > Can I find out why cryptsetup created my LUKS devices with a payload > offset of 4096? > I mean these are 512B sectors right?... I though all tools would > nowadays align to 1 MiB but that would be 2048 S. If there is enough space for keyslots then it is 1MiB. If 1MiB is too small, it uses multiple of default alignment, here 2MiB (See LUKS design document for exact info how keyslot is used.) I am almost sure you used XTS with 512bit key, that's exactly this case - 1MiB is not enough for it. Try to use 256b key for XTS (e.g. default) and you will get 2048s. (BTW this is one of the reason we stick with 256bit XTS -> AES128 to not increase LUKS keyslots size. For other reasond please seach this list - this discussion was surely here.) > Is it _really_ that smart that it auto detected this and also included > the LVM's PE size into it's calculations? No. Nothing is so smart as LVM :-] It is just plain round up to multiple of requested (default) alignment. Milan