I am currently trying to set up multiple devices with Ubuntu (20.04.5 LTS) and the drive must be encrypted, so I used LUKS during the installation. (I checked "Use LVM with the new Ubuntu installation" + "Encrypt the new Ubuntu installation for Security" in the process)
However, the encrypted drive is much slower (as expected), but I read this article about the possibility to speed up dm-crypt I/O operations, using two flags no_read_workqueue
and no_write_workqueue
(last paragraph). FYI: I am using a NVMe SSD. The patch has been merged into the Linux Kernel 5.9 and onwards, I have 5.14, so it should be available for me. How can I enable this by default?
I have already changed the /etc/crypttab
file by adding the flags:
nvme0123abcdef-etc UUID=123abcdef-etc none luks,discard,no-write-workqueue,no-read-workqueue
That hasn't changed the speed at all.
I tried to set the default flags:
cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent refresh root
then I will get an error: --perf-no_read_workqueue: unknown option
Furthermore the flags are not shown when I use cryptsetup luksDump /dev/sdaX | grep Flags
-> (This shows "none") or dmsetup table
-> (This shows allow_discards
)
FYI: I used this Wikipage for infos: https://wiki.archlinux.org/title/Dm-crypt/Specialties