cryptsetup command is failing with code -1 (wrong or missing parameters)
by Praveen_Rinku from LinuxQuestions.org on (#598AW)
I am trying to encrypt /dev/sda5 with cryptsetup. I have my own product specific installer. So during installation phase I am running the below command from one of the script. I have copied cryptsetup binary, libcryptsetup library files and dm-crypt module into my setup and module is already insmoded into kernel.
Now when I run below command first it complains about absence of /run/cryptsetup file
that I manually create. Now when I run the below command I get another set of errors and I am clueless as what I am missing. I am using customized debian buster and since I have my own installer so I can not use default debian installer.
#cryptsetup -y -v --type luks2 luksFormat /dev/sda5
WARNING !
===========
This will overwrite data on /dev/sda5 irrevocably.
Are you sure ? (Type uppercase yes) : YES
Enter passphrase for /dev/sda5:
Verify passphrase:
Existing 'crypto_LUKS' superblock signature on device /dev/sda5 will be wiped.
Existing 'crypto_LUKS' superblock signature on device /dev/sda5 will be wiped.
Command failed with code -1(wrong or missing parameters)


Now when I run below command first it complains about absence of /run/cryptsetup file
that I manually create. Now when I run the below command I get another set of errors and I am clueless as what I am missing. I am using customized debian buster and since I have my own installer so I can not use default debian installer.
#cryptsetup -y -v --type luks2 luksFormat /dev/sda5
WARNING !
===========
This will overwrite data on /dev/sda5 irrevocably.
Are you sure ? (Type uppercase yes) : YES
Enter passphrase for /dev/sda5:
Verify passphrase:
Existing 'crypto_LUKS' superblock signature on device /dev/sda5 will be wiped.
Existing 'crypto_LUKS' superblock signature on device /dev/sda5 will be wiped.
Command failed with code -1(wrong or missing parameters)