I have a Raspberry Pi4 (4GB) with a 250GB SSD connected via USB3. The SSD has a write speed of about 70MB/s, which is very nice. The SSD is mounted via fstab and the following settings:
LABEL=DATA /media/extStorage exfat-fuse nofail,auto,sync,gid=www-data,rw,umask=007 0 0
But I have a VeraCrypt encrypted file container which is about 95% of the SSD volume size. When I mount the container with the command
sudo -u root veracrypt /media/extStorage/data.hc /mnt/data/ --pim=230 -k "" --protect-hidden=no --fs-options "gid=www-data,umask=007"
the write speed is only about 3MB/s, which is 1/18th of the originally speed... When mounted and while writing the process "/sbin/mount.exfat-fuse /dev/sda1 ..." has a very high CPU usage:
The command lsof for /media/extStorage shows that only VeraCrypt is accessing.
As far as I understand VeraCrypt, the CPU load should not be that high after mounting... I also tried using a much lower PIM, which was only faster when mounting.
So do I do somthing wrong when mounting the drive or the encrypted container (e.g. wrong or mising commands)? What could cause that kind of problems?
Thank you in advance for your answers.
EDIT: Just to mention: I downloaded the source code of VeraCrypt and compiled it myself on my Raspberry, if that could include an error...
I found that may the lack of a hardware AES module could be the problem... so the Raspberry have to use software AES which is CPU intense and therefore slower... I don't know how to solve this problem, because the RPi does not seem to have that module on the chip... (https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=207888&p=1568740&hilit=aes#p1568740) I never had that kind of problems before, because my Notebook and my Tablet support hardware AES. Maybe another encryption software (like dm-crypt) is more convenient?
EDIT2: This problem was solved by using EXT4 formatting instead of exfat. See my first comment under the first answer.
/media/storage, your comment says
/media/dataand the screenshot states
/media/extStorage. Are you sure you have mounted the right file?