Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 2 Aug 2018 11:20:03 +0200 (CEST) References: <6df9d673-5392-1171-3cd7-ed8a244b565e@linux.ibm.com> From: Ondrej Kozina Message-ID: Date: Thu, 2 Aug 2018 11:20:01 +0200 MIME-Version: 1.0 In-Reply-To: <6df9d673-5392-1171-3cd7-ed8a244b565e@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-MW Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] cryptsetup-reencrypt fails after converting a LUKS1 volume to LUKS2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ingo Franzki , dm-crypt@saout.de On 08/02/2018 10:16 AM, Ingo Franzki wrote: > Hi, > > I have converted an existing LUKS1 volume to LUKS2 via 'cryptsetup convert --type luks2 '. > That worked well. > > After that I am trying to use cryptsetup-reencrypt ro reencrypt the volume using a different volume key. > This fails with 'Cannot format device LUKS-5d6495ba-b6f9-43c5-883f-dff56f10c72a.new.' Ok, I know what's wrong. The convert action works as expected and there's nothing wrong with data offset. The issue is cryptsetup-reencrypt utility currently can't handle setup where existing LUKS2 header, on a device you're about to reencrypt is different size from default LUKS2 header size which is 4MiBs currently. The converted header is as you wrote 2MiBs. Ondrej