Skip to content

[snippet] HowTo – activate trim on a dm-crypt encrypted lvm

Just a short snippet on how to activate the TRIM-capability of your SSD (archlinux).
Warning: this can compromise your systems security (more)

# nano /etc/default/grub

Edit line:

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda4:archlinux-lvm"

to

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda4:archlinux-lvm:allow-discards root_trim=yes ADDITIONAL KERNEL PARAMETER LIST"

After that you need to recreate your grub.cfg:

# grub-mkconfig -o /boot/grub/grub.cfg

Reboot your system.

Try running (as root) fstrim -v /
You should see an output like

645354208 Bytes was trimmed

“root_trim=yes” is only needed on encrypted devices.

Post a Comment

You must be logged in to post a comment.