DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yves-Alexis Perez <corsac@corsac.net>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] cryptsetup FAQ montly posting 8/2011
Date: Tue, 02 Aug 2011 09:35:44 +0200	[thread overview]
Message-ID: <1312270544.22484.24.camel@scapa> (raw)
In-Reply-To: <20110801235305.GA4857@tansi.org>

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]

On mar., 2011-08-02 at 01:53 +0200, Arno Wagner wrote:
> 
>  * Can I resize a dm-crypt or LUKS partition?
> 
>   Yes, you can, as neither dm-crypt nor LUKS stores partition size.
>   Whether you should is a different question. Personally I recommend
>   backup, recreation of the encrypted partition with new size,
>   recreation of the filesystem and restore. This gets around the
>   tricky business of resizing the filesystem. Resizing a dm-crypt or
>   LUKS container does not resize the filesystem in it. The backup is
>   really non-optional here, as a lot can go wrong, resulting in
>   partial or complete data loss. Using something like gparted to
>   resize an encrypted partition is slow, but typicaly works. This
>   will not change the size of the filesystem hidden under the
>   encryption though.
> 
>   You also need to be aware of size-based limitations. The one
>   currently relevant is that aes-xts-plain should not be used for
>   encrypted container sizes larger than 2TiB. Use aes-xts-plain64
>   for that. 

It might be worth mentioning LVM setups for this?

What I do is (exactly like the Debian installer “setup encrypted LVM”
does):

- /dev/sda1 = /boot
- /dev/sda2 -> dm-crypt -> /dev/mapper/sda2_crypt
- /dev/mapper/sda2_crypt = physical volume for LVM

then create a volume group in /dev/mapper/sda2_crypt and logical volumes
in there. My advice would be to not use the full volume group space (I
usually do 10G for /, 10G for /home and 1-2G for swap), then you can
lvextend and resize2fs the stuff. Encryption doesn't get in the way.

Regards,
-- 
Yves-Alexis

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2011-08-02  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 23:53 [dm-crypt] cryptsetup FAQ montly posting 8/2011 Arno Wagner
2011-08-02  7:35 ` Yves-Alexis Perez [this message]
2011-08-02  9:00   ` 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=1312270544.22484.24.camel@scapa \
    --to=corsac@corsac.net \
    --cc=dm-crypt@saout.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox