public inbox for cryptsetup@lists.linux.dev
 help / color / mirror / Atom feed
From: Ondrej Kozina <okozina@redhat.com>
To: cryptsetup@lists.linux.dev
Cc: "Brian J. Murrell" <brian@interlinx.bc.ca>
Subject: Re: online encryption progress
Date: Tue, 17 Oct 2023 11:03:52 +0200	[thread overview]
Message-ID: <206b7fbf-fed4-4c54-86ec-8e8bcfdeafc0@redhat.com> (raw)
In-Reply-To: <633010a561869f927fc1f208f5cf4ae6a2c9587f.camel@interlinx.bc.ca>

On 16/10/2023 19:57, Brian J. Murrell wrote:
> Hi.
> 
> I used:
> 
> # cryptsetup reencrypt --encrypt --init-only --reduce-device-size 32M /dev/md0 md0_encrypted
> # cryptsetup reencrypt --resume-only /dev/md0

This command, unless called with --quiet option, should print progress 
regularly, including percentage already completed.

> 
> to encrypt a device online.
> 
> I can see that it's encrypting:
> 
> # cryptsetup status md0_encrypted
> /dev/mapper/md0_encrypted is active.
>    type:    LUKS2
>    reencryption:  in-progress
>    cipher:  aes-xts-plain64
>    keysize: 512 bits
>    key location: dm-crypt
>    device:  /dev/md0
>    sector size:  512
>    offset:  32768 sectors
>    size:    7813643952 sectors
>    mode:    read/write
> 
> Is there any way to know how far from complete it is?  I.e. percent
> done, etc.?

See above. Status command (in current code) can not output reencryption 
progress data. The information necessary for it to be correct are stored 
in LUKS2 metadata (on disk). We'd have to construct new reencryption 
context which is protected by lock held by current reencryption process 
(cryptsetup reencrypt --resume-only /dev/md0 process).

Kind regards
O.


      reply	other threads:[~2023-10-17  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 17:57 online encryption progress Brian J. Murrell
2023-10-17  9:03 ` Ondrej Kozina [this message]

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=206b7fbf-fed4-4c54-86ec-8e8bcfdeafc0@redhat.com \
    --to=okozina@redhat.com \
    --cc=brian@interlinx.bc.ca \
    --cc=cryptsetup@lists.linux.dev \
    /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