Tag Archives: 14.04

Enable TRIM (SSD) on encrypted (and/or) LVM volume

For it to work you need several adjustments, every layer needs to support TRIM, have the support enabled and pass the information down to the next, till it reaches the physical layer.

Lets start at the highest layer in the stack, the filesystem:
Edit /etc/fstab to include the discard mount option where needed (keep in mind that the FS needs to support it, ext4 does):

/dev/mapper/lvm_crypt /data           ext4    defaults,discard        0       2

Next comes the logical volume manager – which is optional and should by default be setup correctly already. Anyway check to be sure that you got the following line in /etc/lvm/lvm.conf:

issue_discards = 1

Last but not least we need to tell the encryption layer to issue the trim commands too. For this to work you need to edit /etc/crypttab to include the discard option:

lvm_crypt UUID=a-uuid-or-device-path none luks,discard

After having changed the crypttab (and lvm.conf) it is neccessary to update the initrd image for the changes to take effect (at next boot):

sudo update-initramfs -k all -c

Reboot and test if it’s working:

sudo fstrim /data


XRDP connection error, gnome Vino security settings

After having installed the new Trusty 14.04 LTS release – finally, I came across a problem that showed to be caused by the “new” default security setting of Gnome Vino. I was no longer able to connect to the console through XRDP:

XRPD: Connection Log
Connection Log … error – problem connecting

Fix is simple:

user@localhost:~$ gsettings set org.gnome.Vino require-encryption false

Of course you need to enable desktop sharing, allow other users to view your desktop and require the user to enter a password when connecting in the preferences, like before.

After that, login again and you are able to connect to the console via XRDP again.