> All 3 work for me in a bookworm VM, please try with `--debug` (with and
> without `-v`).

and it works for me *if* - as you did - I format the device.
But if I *don't* format it then I still get the same result,
even with newer packages:

testaroli# dpkg -l | grep cryptsetup
ii  cryptsetup-bin          2:2.6.1-3  amd64  disk encryption support - command 
line tools
ii  libcryptsetup12:amd64   2:2.6.1-3  amd64  disk encryption support - shared 
library
testaroli# 
testaroli# dd if=/dev/zero bs=1M count=64 of=/tmp/disk.img
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.0806509 s, 832 MB/s
testaroli# cryptsetup isLuks /dev/loop0; echo "\`cryptsetup isLuks\` exited 
with status $?"
`cryptsetup isLuks` exited with status 1
testaroli# cryptsetup isLuks -v /dev/loop0
Command failed with code -1 (wrong or missing parameters).
testaroli# 

It should say "not Luks" or perhaps "invalid device", but 
"wrong or missing parameters" is wrong.

With --debug:

testaroli# cryptsetup isLuks --debug -v /dev/loop0
# cryptsetup 2.6.1 processing "cryptsetup isLuks --debug -v /dev/loop0"
# Verifying parameters for command isLuks.
# Running command isLuks.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/loop0.
# Trying to open and read device /dev/loop0 with direct-io.
# Trying to open device /dev/loop0 without direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/loop0.
# Crypto backend (OpenSSL 3.0.8 7 Feb 2023 [default][legacy]) initialized in 
cryptsetup library version 2.6.1.
# Detected kernel Linux 6.1.0-6-amd64 x86_64.
# Loading LUKS2 header (repair disabled).
# Acquiring read lock for device /dev/loop0.
# Opening lock resource file /run/cryptsetup/L_7:0
# Verifying lock handle for /dev/loop0.
# Device /dev/loop0 READ lock taken.
# Trying to read primary LUKS2 header at offset 0x0.
# Opening locked device /dev/loop0
# Verifying locked device handle (bdev)
# Trying to read secondary LUKS2 header at offset 0x4000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x8000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x10000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x20000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x40000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x80000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x100000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x200000.
# Reusing open ro fd on device /dev/loop0
# Trying to read secondary LUKS2 header at offset 0x400000.
# Reusing open ro fd on device /dev/loop0
# LUKS2 header read failed (-5).
# Device /dev/loop0 READ lock released.
# Releasing crypt device /dev/loop0 context.
# Releasing device-mapper backend.
# Closing read only fd for /dev/loop0.
Command failed with code -1 (wrong or missing parameters).
testaroli# 

Alexis

Reply via email to