[dm-crypt] moving/resizing a dm-crypt partition

Matthias Schniedermeyer ms at citd.de
Fri Jan 31 11:29:09 CET 2014

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. :-)



More information about the dm-crypt mailing list