[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to enlarge LUKS partition ?



On Wed, Aug 22, 2012 at 1:49 AM, tv.debian@googlemail.com
<tv.debian@googlemail.com> wrote:
>>On 21/08/2012 19:22, J. B wrote:
> [trim]
>
>> The free space is 10 GB, where the luks partition is 200 GB.
>> I'm eagerly waiting to know the output of your experiment.
>>
>
> Ok, I was under the impression from your first post that the free space was
> 800GB.
>
> I didn't have time to do extensive tests but with such a small space
> available compared to the size of the LUKS there is no sane way to do what
> you want. I didn't manage to make the "fdisk method" work backward, even
> with a LUKS header backup it doesn't seem to be possible.
>

I wonder what would happen if you gave dd overlapping regions of the
disk to read from and write to.

Something like (CAUTION, do not run):

dd if=/dev/sda skip=5000 of=/dev/sda seek=1000

> At some point you will need to "dd" out your LUKS container, then "dd" it
> back to a newly created partition including the free space. This would imply
> a 200GB space available somewhere, and would take ages to complete.
>
> You are better off to backup the data, take good notes of partition UUID,
> LUKS container as well as vg and lv details.
> Then create a new partition including the free space and previous sda2
> (force same UUID as the old one with "tune2fs -U"), create a fresh LUKS
> (again maintaining same UUID for convenience), do the same for the lvm layer
> and copy data back.
>
> If you write random data over the backup afterward or backup to a temporary
> LUKS container this will leave no trace of the data in clear. Of course
> you'll need enough space somewhere, but likely less than the 200GB of the
> LUKS container.
>
> Sorry, can't get LUKS to walk backward :-{

-- 
regards,
kushal


Reply to: