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.

10 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.