vzhilov / WDMC-Ex2-Ultra

Enhanced Ram Disk and Linux Kernel for WD My Cloud Ex2 Ultra
32 stars 9 forks source link

cryptsetup failed with code 22 #2

Open matrob opened 4 years ago

matrob commented 4 years ago

I have followed the instructions from the readme exactly, but stop at the following point: cryptsetup -v --type luks --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 2000 --use-random --verify-passphrase luksFormat /dev/md0

I receive the following command line output: # command failed with code 22: invalid argument

EDIT: The ArchWiki helped me to better understand cryptsetup and helped to solve the problem. https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Cryptsetup_usage

vzhilov commented 4 years ago

Ex2 Ultra device has hardware CESA enctyption built-in: https://wiki.kobol.io/helios4/cesa/

So I found it is better to use aes-cbc-essiv, that is about twice faster than the cipher above. So the correct command should be:

cryptsetup -v -y -c aes-cbc-essiv:sha256 luksFormat /dev/sda1

I have fixed the README.