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

Arno Wagner arno at wagner.name
Thu Jan 30 22:06:09 CET 2014


On Thu, Jan 30, 2014 at 17:04:44 CET, Louis-David Mitterrand wrote:
> Hi,
> 
> My linux system is on a dm-crypt volume with btrfs on /dev/sda6. As I
> just recovered 100GB from windows (/dev/sda5) I'd like to merge 5 and 6
> to have a larger dm-crypt volume. Here is the disk layout:
> 
>    1            2048         2050047   1000.0 MiB  2700  Basic data partition
>    2         2050048         2582527   260.0 MiB   EF00  EFI system partition
>    3         2582528         4630527   1000.0 MiB  8300  Basic data partition
>    4         4630528         4892671   128.0 MiB   0C01  Microsoft reserved part
>    5         4892672       218167295   101.7 GiB   8300  Basic data partition
>    6       464865280      1000215182   255.3 GiB   8300  Linux filesystem
> 
> What is the best strategy to acheive that? I'm thinking of booting a
> live cd, creating a new dm-crypt volume on 5, copy the system from 6 to
> 5, remove 6, resize partition 5, cryptfs resize 5, btrfs resize 5.
> 
> Is there a better way?

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. 

Arno

-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno at wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -  Plato


More information about the dm-crypt mailing list