[SOLVED] Luks full disk encryption and trim problem on Manjaro Gnome

Ok - by now I finally figured it out - luckely - one push into the right direction was finally enough ^^

That is how it in the end worked:

/etc/defaults/grub
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=5[UUID-1]:luks-[UUID-1]:allow-discards root=/dev/mapper/luks-[UUID-1] rd.luks.options=discard"

The :allow-discards was the problem - I did not realize where that belongs to - and without it the rd.luks.options=discard is not enough.

cat /etc/crypttab
luks-a41fc631-f90f-4521-88e1-58dd3024c1cc UUID=a41fc631-f90f-4521-88e1-58dd3024c1cc     /crypto_keyfile.bin luks,allow-discards

.

cat /etc/fstab
#root file system inside crypt container
UUID=62b07007-8b9d-4884-9043-1025eb672ad3 /              ext4    defaults,noatime,discard 0       1
#swap inside crypt container
UUID=421eb224-140b-487a-b95d-366b8b448117 none		 swap	 defaults,discard 	  0	0
#temporary filesystem (ramdisk) for /tmp 
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0       0

To sum it up:
Both rd.luks.options=discard and :allow-discards are needed in the kernel commandline to tell luks to allow the trim command to pass down to the drive.

Same goes for the luks,allow-discards in the /etc/fstab for those volumes that are handled by it (in my case swap only)

And last but not least, either add discard in the /etc/fstab or use the system service to do it periodically.

@Zoltan thanks for your time - as to what might be different - maybe your install included the right kernal parameters by default - i don’t know =)

3 Likes