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 5KWVBOMgju9L for ; Fri, 31 Jan 2014 11:29:12 +0100 (CET) Received: from awesome.dsw2k3.info (awesome.dsw2k3.info [IPv6:2a01:198:661:1f::3]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Fri, 31 Jan 2014 11:29:12 +0100 (CET) Date: Fri, 31 Jan 2014 11:29:09 +0100 From: Matthias Schniedermeyer Message-ID: <20140131102909.GB7335@citd.de> References: <20140130160443.GA31280@apartia.fr> <20140130210609.GB27307@tansi.org> <20140131094929.GB6499@apartia.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140131094929.GB6499@apartia.fr> Subject: Re: [dm-crypt] moving/resizing a dm-crypt partition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Louis-David Mitterrand Cc: dm-crypt@saout.de On 31.01.2014 10:49, Louis-David Mitterrand wrote: > On Thu, Jan 30, 2014 at 10:06:09PM +0100, Arno Wagner wrote: > > > > Yes, most decidedly: Make a full backup of everything > > you want to keep on 6, remove 5 and 6, create what you > > want in its place and restore the backup. > > You may also do a full backup of the rest of the disk, > > mistakes and error happen. > > > > As backup is mandatory anyways, this shoud not cause > > much more trouble than an ordinary backup. > > > > You are running a pretty high risk of losing everything on > > 6 with your approach. > > Hi Arno, > > I did a tar.gz backup before proceeding but in the end all went well. > The hairy part (I guess) is deleting both partitions to create a new, > larger one without damaging the dm-crypt volume. > > I resized the dm-crypt volume offline, without mounting the fs, but is it > possible to do it on a live, mounted system? Only in the case where you don't change the start of the partition. So in your case: No And i'm not sure if it is fixed/changed, but at least historically Linux doesn't reread a changed partition table if any partition is currently "in use". If that is still unchanged, you could change the MBR, but Linux wouldn't change the in-memory representation. So you couldn't enlarge the underlaying partition(/block-device), without making the whole block-device "unused" first, which is kind of hard for a device with the root-partition. :-) -- Matthias