I recently bought an Intel 520 SSD on which I installed Opensuse 12.2 within an Luks-encrypted LVM container for an ext4-filesystem. My kernel (3.XX) and Cryptsetup (1.5), as well as the file-system (Ext4) support TRIM-commands through the “discard” option as I understand it; enabled through “/etc/fstab”. However for TRIM to fully work, the “discard” option has to be passed onto the crypto filesystem. This can be done manually when opening the container through
. However adding either “discard” or “allow-discards” to my "/etc/crypttab"does not have any effect after reboot, despite rebuilding the boot-environment with “mkinitrd”.
Should be working in 12.3 with systemd; at least, current upstream systemd code understands allow-discards. Of course, whether mkinitrd supports it as well is another question (for encrypted root and/or swap).
Was based on content largely from wiki.archlinux.
That wiki has since been updated with new optimizations but the recommendations in my presentation are plenty good enough… use of tempfs, implement TRIM, change I/O scheduler, how to monitor disk usage in realtime.
TRIM operates at the disk trap level, approx same as block level, what/where is the reference suggesting that encryption level is relevant?
so there is no provision for passing additional arguments. You may try to open feature request on https://features.opensuse.org/
Alternative is to try dracut. I have been using it for some time when it was young (on another distro) and it worked quite well. I just checked and upstream version supports allow-discards. Downside - I am not sure whether it is integrated with other configuration tools, so you may need to create initrd manually after kernel installation (or after any configuration change that requires initrd rebuild).
and rebuilding mkinitrd. The system boots without hickups and the cryptcontainer holding the root-fs reports that it supports discards. However /home which resides on another partition does not give the same happy message which indicates (!?) that systemd on openSUSE 12.2 does not take heed of either allow-discards or discard in /etc/crypttab.
Hint - script setup-luks.sh is executed when you run mkinitrd. This script can save environment for later use in initrd. So if you really want this to be fixed, you should extend setup-luks.sh to parse options and save information for boot-luks.sh to conditionally use --allow-discards. Then open bug report, attach your patch and hope for the best
All you should need to do is append the following to your grub configuration, using Yast > Bootloader > Boot Loader Options > Optional Kernel Command Line Parameter
Which openSUSE version and which initrd are you using? I do not see anything that would interpret this parameter in mkinitrd. AFAIK this is ArchLinux specific.
I’d like to give opensuse a try, but this is keeping me back. The “dirty solution” by esox81 didn’t seem to work for me. Perhaps I had some other configurations wrong, as setting things up seems to be quite different from debian. Is there a noob proof way to make this work?