Veracrypt Error device-mapper: reload ioctl Error Fixed
When trying to mount an encrypted drive using Veracrypt I encountered this error:
chewett@bunker-master2:/mnt$ veracrypt /dev/sdc1 gen500 Enter password for /dev/sdc1: Enter PIM for /dev/sdc1: Enter keyfile [none]: Protect hidden volume (if any)? (y=Yes/n=No) [No]: Error: device-mapper: reload ioctl on veracrypt2_0 failed: No such file or directory
I did some research and found out that this means your kernel or device doesn’t natively support the encryption scheme you are using.
Mounting without kernel cryptography
Instead of using kernel cryptography you can tell Veracrypt to use software based encryption. This is slower than doing it in the kernel or hardware layer but will allow you to mount the drive. Adding the -m=nokernelcrypto
option will mount the drive and should fix the above issue. An example is
veracrypt -m=nokernelcrypto /dev/sdc1 gen500
This can be useful if you want to mount the drive without any further action however as noted above it will be slower.
Mounting with kernel crypto
I found out that the reason I couldn’t mount a veracrypt volume was because it was encrypted with AES (Twofish(Serpent)). My Raspberry Pi 2 didn’t support this encryption scheme so was giving the above error.
However by decrypting it and re-encrypting the data with AES my Raspberry Pi was able to decrypt it without using the nokernelcrypto
flag.
The advantage of this is you get a pretty decent speed improvement since it is able to run the crypto in kernel mode.
Thank you for this post.
I switched from a Truecrypt-container with “cryptsetup” to Veracrypt recently and ran into the same error-message. (“Error: device-mapper: reload ioctl on veracrypt1 failed: No such file or directory”)
The Linux built-in cryptsetup should be able to open Veracrypt containers with systemd version 232 and cryptsetup version 1.6.7. (Source: https://unix.stackexchange.com/questions/203048/crypttab-and-veracrypt) However my Raspberry Pi-NAS runs on some older versions.
Finally, this is sorted. 🙂
I’m glad you hear you got it working 🙂
Thanks it worked for me
Thanks for your post. It allowed me to get veracrypt working on one of my raspberrypis.
Hi men, thank you vera much for you tips!
It’s very cool!
I’m still having problems with this. I’m getting the “Error: device-mapper: reload ioctl on veracrypt1 failed: Invalid argument
Command failed”
This is the command I’m runnting to encrypt the drive
sudo veracrypt -t -c -m=nokernelcrypto –quick /dev/sdb1
I’m running ubuntu 18.04 on a jetson nano running on an ARMv8, which also may be my problem. Any ideas?
What is the veracrypt volume formatted as? I had issues before when it was formatted with more complex encryption and found AES worked.
I dont have a jetson nano but the issue is related to the ARMv8 arch and the kernel you are running, so it should be the same as the issues I had on the Pi.
I used AES and sha-512, and formatted ntfs. I tried both with a freshly wiped drive and created a gpt partition for /dev/sdb1. I also tried formatting the partition as ntfs before running veracrypt. Both return the exact same error.
I installed veracrypt using apt, which may not be an arm build. Do you have a suggestion on how to build veracrypt with my device?
Also, thanks for the quick response.
Under settings in VeraCrypt, you can disable using Kernel for encryption.
Location: Settings > Preferences > System Integration
That sounds like a useful comment, thanks!