From: Ondrej Kozina <okozina@redhat.com>
To: dm-crypt@saout.de
Cc: abhrajyoti@gmail.com
Subject: Re: [dm-crypt] Cryptsetup-reencrypt failing with error with option --new reduce-device-size
Date: Fri, 20 Jun 2014 15:29:48 +0200 [thread overview]
Message-ID: <53A4374C.9080705@redhat.com> (raw)
In-Reply-To: <CAKL--+hCD17W62DxkOfXGTitgnqyq33+EhqA077-ExN7LCMQuQ@mail.gmail.com>
On 06/20/2014 02:36 PM, Abhrajyoti Kirtania wrote:
> HI,
> I able to build the crypt setup-reencrypt binary and trying to enable
> encryption on a particular partition with this tool, build failing with
> error like:
>
> *Cannot wipe header on device /dev/loop0. if i pass
> *--reduce-device-size as 1024. But if i pass this size as 4096 then
> getting the error as "Device /dev/loop0 is too small."
>
> Not sure what might be the root cause of this error. Truly appreciate
> your kind support?
>
> cryptsetup-reencrypt /dev/sda8 --new --reduce-device-size 1024 --debug
>
>
> WARNING: this is experimental code, it can completely break your data.
>
> # cryptsetup 1.6.4 processing "./abhra_new/sbin/cryptsetup-reencrypt
> /dev/sda8 --new --reduce-device-size 1024 --debug"
Hi Abhrajyoti,
you have to create enough space to fit new LUKS header during
reencryption of not yet encrypted device. The LUKS header is
approximately 1MiB in size (it differs and depends also on other
parameters). The default unit for --reduce-device-size is a byte. Try to
use --reduce-device-size 2048S (where 'S' stands for sectors). If I
recall correctly --reduce-device-size must be aligned to 512B (dm-crypt
sector size) or maybe even to page size (4 KiB).
Be extremely careful with the --new option! You have to create unused
space at the end of the original device which is equal in size to
--reduce-device-size option. By term unused I mean there are no real
filesystem data or any data important to you. Otherwise you will you
loose this data. The best to achieve this would be to actually extend
the partion or LV at its end exactly by intended --redude-device-size
parameter first.
Kind regards
Ondrej
next prev parent reply other threads:[~2014-06-20 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 12:36 [dm-crypt] Cryptsetup-reencrypt failing with error with option --new reduce-device-size Abhrajyoti Kirtania
2014-06-20 13:20 ` Milan Broz
2014-06-20 13:29 ` Ondrej Kozina [this message]
2014-06-20 14:16 ` Abhrajyoti Kirtania
2014-06-20 19:26 ` Arno Wagner
2014-06-20 22:16 ` Robert Nichols
2014-06-21 2:33 ` Arno Wagner
2014-06-24 16:53 ` Abhrajyoti Kirtania
2014-06-24 17:57 ` Milan Broz
2014-06-25 8:34 ` Abhrajyoti Kirtania
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=53A4374C.9080705@redhat.com \
--to=okozina@redhat.com \
--cc=abhrajyoti@gmail.com \
--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 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.