Return-Path: Received: from biostat.ucsf.edu (upstrm185.psg-ucsf.org [38.99.193.74]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Fri, 9 Oct 2009 22:45:36 +0200 (CEST) From: Ross Boylan Content-Type: text/plain Date: Fri, 09 Oct 2009 13:45:21 -0700 Message-Id: <1255121121.30192.50.camel@corn.betterworld.us> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [dm-crypt] how much extra space for LUKS? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de Cc: ross@biostat.ucsf.edu I want to shrink a LUKS partition which has an underlying LVM logical volume. I am trying to figure out the relation between the size of the filesystem, the size of the encrypted volume, and the size of the underlying volume. Converting everything to sectors, cryptsetup status reports 50,329,592 size 2,056 offset df says encrypted device is 47,180,528 dumpe2fs says the size of the filesystem ("Block count") is 50,331,648 which is identical to the size of the underlying device reported by lvs. My naive expectation was that the underlying device size ( 50,331,648 ) minus header (2,056; I suppose 2,055 actually) should equal the reported size of the encrypted volume. No such luck. Concretely, the question is "if I shrink the file system size to n, what value should I tell cryptsetup resize to use, and then what value should I use resizing the underlying lvm volume?" Thanks. Ross Boylan P.S. If anyone could answer my earlier question about how to de-LUKS an encrypted partition, that would be great.