DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: f-dm-c@media.mit.edu
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] cryptsetup
Date: Wed, 02 Sep 2009 07:13:30 +0200	[thread overview]
Message-ID: <4A9DFEFA.205@redhat.com> (raw)
In-Reply-To: <200909020301.XAA06354@out-of-band.media.mit.edu>

f-dm-c@media.mit.edu wrote:
> Shouldn't there be a "cryptsetup resize" in there somewhere?
> [Presumably before you resized the ext2]

There is no device size stored in LUKS header, only data offset.

So after luksClose/luksOpen the device has always new size, of course
if you increase size extended part of device still contains old data.

You can also resize device online - just use "cryptsetup resize <name>".
(The --size parameter is not mandatory, man page is wrong here,
if --size is not provided, it will expand to whole device).

So if you have LUKS on partition, and you want extend it: 
extend partition -> resize crypt mapping (or deactivate/activate) -> resize fs

For reducing just do it in reverse order
resize fs -> deactivate cryptsetup -> reduce partition.
(if you need it online, you will have to specify --size for cryptsetup resize,
note that --size is in sectors)

Milan
--
mbroz@redhat.com

  reply	other threads:[~2009-09-02  5:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02  1:14 [dm-crypt] cryptsetup solarflow99
2009-09-02  2:42 ` test532
2009-09-02  3:01   ` f-dm-c
2009-09-02  5:13     ` Milan Broz [this message]
2009-09-02 10:12 ` Gilles PIETRI
  -- strict thread matches above, loose matches on Subject: below --
2012-04-20 11:37 omar ahizoun
     [not found] <CAAdJYJY6e9XTbZs8VTji9WKSPvEs7w4J8xxXLeo9=htOZS_5Hw@mail.gmail.com>
2017-11-10 17:05 ` [dm-crypt] Cryptsetup Steven Houtchen

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=4A9DFEFA.205@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=f-dm-c@media.mit.edu \
    /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