I have installed TW on a fully encrypted partition during installation and the system is asking for the passphrase at the very beginning of the boot procedure. I discovered though that the options placed by the installer in crypttab do not allow trimming in the encrypted section.
Is it enough to add the ,discard option after the last existing option in crypttab and reboot the system to enable trimmimg or do I have to do anything else too?
How can we answer it without seeing the existing line to which you are going to add this option? Please use preformatted text (not bold, italic etc) when pasting /etc/crypttab content.
I’ll try to reply to all your messages at once with this one.
@arvidjaar you’re right. When I tried to edit my post in order to add the crypttab line, the system wouldn’t allow me to edit it. I’m sorry I didn’t add it the first time I posted it.
I found the solution accidentally when I was searching for something else on the internet. Maybe you can verify that nothing else is to be done. I think it should be OK though since I’ve already tested trimming and it worked.
I added the discard option in /etc/crypttab and now the file looks like this:
@snoopy the discard option works fine if it’s last as long as it is placed in the 4th (options) section separated from the other options by a comma. Not a space. It also worked in the previous distribution I was using before I switched to TW.
I verified that the option issue_discards = 1 existed in /etc/lvm/lvm.conf, since I’m using lvm volumes inside the encrypted partition, and it was there.
Finally I executed dracut -f --regenerate-all and rebooted the system.
After the reboot I executed fstrim --fstab --verbose and it showed that both the /boot/efi and the encrypted root partitions had been trimmed.
I think everything should be OK now but, as I said above, I would appreciate it if you could verify that too.