[pkg-cryptsetup-devel] cryptsetup failed with code 22 invalid argument
Guilhem Moulin
guilhem at debian.org
Tue Jul 7 06:13:35 BST 2020
On Tue, 07 Jul 2020 at 14:29:58 +1000, Miranda Zhang wrote:
> but blkid <device> have shown it as TYPE="crypto_LUKS"
> Is it already successful?
No, you might have more modules missing. Assuming the cryptsetup binary
comes from Debian the default cipher/mode/IV is aes-ats-plain64, are
these modules available and loaded to? You will probably need aes, xts
and ecb (or aesni), maybe more, see /proc/crypto. Is this a stock
Debian kernel or do you build your own?
To see if the culprit is with cryptsetup or something else, you can even
try to map a test device manually using the same ciphers/mode/IV:
dd if=/dev/zero bs=1M count=64 of=/tmp/disk.img
losetup -f /tmp/disk.img
dev=/dev/loop0 # loop device allocated above
dmsetup create testcrypt --table "0 $(blockdev --getsz $dev) crypt aes-xts-plain64 $(xxd -l64 -c256 -ps </dev/urandom) 0 $dev 0"
Does that work? (Is a new block device /dev/mapper/testcrypt being
created?) If it does then the problem is with cryptsetup itself,
otherwise it's something lower level.
--
Guilhem.
More information about the pkg-cryptsetup-devel
mailing list