Unable to resize a VeraCrypt container
Issue description
Hello, I'm trying to resize a VeraCrypt container but I'm getting an error.
Steps for reproducing the issue
$ veracrypt --text --create test.img --password 123 --hash sha512 --encryption aes --filesystem fat --size 30M --force
$ head -c 20M /dev/urandom >> test.img
$ sudo losetup /dev/loop1 test.img
$ sudo cryptsetup open --type tcrypt --veracrypt /dev/loop1 test
$ sudo cryptsetup resize test -v
Command failed with code -1 (wrong or missing parameters).
Additional info
The steps work fine with a standard LUKS container (if followed by disk check and fs resize). This is on Debian 10 running cryptsetup git 876ca.
Debug log
Output with --debug option:
$ sudo cryptsetup --debug resize test -v
# cryptsetup 2.4.0-git processing "/home/aaa/cryptsetup/.libs/cryptsetup --debug resize test -v"
# Running command resize.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating crypt device context by device test.
# Initialising device-mapper backend library.
# dm version [ opencount flush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# Detected dm-ioctl version 4.39.0.
# Detected dm-crypt version 1.18.1.
# Device-mapper backend running with UDEV support enabled.
# dm status test [ opencount noflush ] [16384] (*1)
# Releasing device-mapper backend.
# Trying to open and read device /dev/loop1 with direct-io.
# Allocating context for crypt device /dev/loop1.
# Trying to open and read device /dev/loop1 with direct-io.
# Initialising device-mapper backend library.
# dm versions [ opencount flush ] [16384] (*1)
# dm table test [ opencount flush securedata ] [16384] (*1)
# Trying to open and read device /dev/loop1 with direct-io.
# dm versions [ opencount flush ] [16384] (*1)
# dm status test_1 [ opencount noflush ] [16384] (*1)
# dm versions [ opencount flush ] [16384] (*1)
# dm table test [ opencount flush securedata ] [16384] (*1)
# Trying to open and read device /dev/loop1 with direct-io.
# Resizing device test to 0 sectors.
# dm versions [ opencount flush ] [16384] (*1)
# dm table test [ opencount flush securedata ] [16384] (*1)
# Trying to resize underlying loop device /dev/loop1.
# Calculated device size is 102144 sectors (RW), offset 256.
# Releasing crypt device /dev/loop1 context.
# Releasing device-mapper backend.
# Unlocking memory.
Command failed with code -1 (wrong or missing parameters).