All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Kozina <okozina@redhat.com>
To: James Dehnert <zeke.dehnert@getcruise.com>, dm-crypt@saout.de
Subject: Re: [dm-crypt] Expanding a LUKS partition to a second drive.
Date: Wed, 12 Feb 2020 11:45:06 +0100	[thread overview]
Message-ID: <0089ec51-ddaa-b572-2b9a-2fdb56b7c1c2@redhat.com> (raw)
In-Reply-To: <CAE3N1D+_pZNQGwi8O4dP3c_Hv8PMGkqYHieqTsrfXEi0d1_HGQ@mail.gmail.com>

Hi,

On 2/11/20 8:21 PM, James Dehnert wrote:
> Greetings dm-crypt group,
> 
> I have a situation where I have an existing LUKS encrypted partition 
> (root) and the user wants to expand that partition onto a second drive.
> 
> The existing partition was created at configuration as part of the 
> Ubuntu preseed setup.
> 
> I know how to do this with LVM, but I'm not sure if this can be done 
> without backing up all the data, and then rebuilding the system from 
> scratch.

If you have encrypted LV (LUKS on top of LV) you can extend that LV over 
another PV (block device or partition) and just call cryptsetup resize.
This will work and you can do it even without taking LUKS device 
offline. In fact I've added support for it into fsadm script and you 
would just need to call "lvextend -r" and it would resize active crypt 
device for you automatically.

> 
> I'm not sure where the LUKS volume is created in respect to LVM.  I 
> can't tell if its created directly on the physical volume, on the volume 
> group, or on the logical volume, so I'm noy sure where I should be 
> looking to expand the substrate.  Or if this is even possible.

See lsblk output with said active LUKS device. That should give you a hint.

If the PV is encrypted (LUKS on top of /dev/sdx and PV on top of LUKS) 
there's no way how to extend one LUKS device over two devices or 
partitions. We don't want cryptsetup to became yet another logical 
volume management:)

Regards O.

  reply	other threads:[~2020-02-12 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 19:21 [dm-crypt] Expanding a LUKS partition to a second drive James Dehnert
2020-02-12 10:45 ` Ondrej Kozina [this message]
2020-02-12 14:29   ` Robert Nichols
2020-02-12 15:01     ` Ondrej Kozina
2020-02-12 19:15       ` Robert Nichols
2020-02-12 16:48 ` Arno Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0089ec51-ddaa-b572-2b9a-2fdb56b7c1c2@redhat.com \
    --to=okozina@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=zeke.dehnert@getcruise.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.