Re: Cryptsetup renecrypt failed in LUKS2 metadata initialization

Ondrej Kozina <[email protected]> Tue, 24 Mar 2026 10:17:31 +0100
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
Hi,

On 21/03/2026 09:03, Mike Wong wrote:
> Hi,
> 
> I got a "Command failed with code -1 (wrong or missing parameters)" error when trying to reencrypt a plain btrfs partition. I'm using the latest version 2.8.4 in a ubuntu 24.04 box.
> 
> What's the cause of the problem and how could it be solved? Help is much appreciated.
> 
> Below is the --debug output:
> ```
> # cryptsetup 2.8.4 processing "cryptsetup reencrypt --encrypt --type luks2 --reduce-device-size 32M --init-only --debug /dev/sda4"

(...)

> # PBKDF benchmark: memory cost = 0, iterations = 642509, threads = 0 (took 51 ms)
> # PBKDF benchmark: memory cost = 0, iterations = 642509, threads = 0 (took 816 ms)
> # Benchmark returns pbkdf2(sha256) 642509 iterations, 0 memory, 0 threads (for 1640-bits key).
> # Keyslot 1 unassigned from digest 0.
> # Keyslot 1 unassigned from digest 1.
> # Keyslot 1 assigned to digest 1.
> # Failed to read data at offset 0 (size: 16777216)
    ^^^^^^^^^^^^^^^^

There's fail in reading the inital data block on /dev/sda4. Do you see 
anything significant in syslog (kernel) about it?

Could you post "lsblk -t /dev/sda4" output?

Also, for bug reporting the 
https://gitlab.com/cryptsetup/cryptsetup/-/work_items is better platform.

Anyway, I'll take a more detailed look eventually, but without block 
device parameters I will not be able to be of much help.

One more thing, do you have the btrfs filesystem mounted by any chance?

With regards
O.