Tuesday, January 10, 2017

LUKS & SSD

I tried out Fedora on my laptop. The installation went rather smooth. My laptop has a SSD that I used as my primary drive and I installed using it alone, using LUKS and LVM.

Since it is an SSD, I needed to configure things to allow discards so I could run a trim command against it. While I have done this before, I had not on Fedora. So I did some searching and came across a Q&A about the proper way of setting up fstrim on Fedora 23. I did not run into the same problems that person ran into that required extra steps so I wanted to share what worked for me.

I had to do the following:
  1. Change /etc/lvm/lvm.conf to set issue_discards=1
  2. Add 'discard' to the line in /etc/crypttab for my volume as the 4th field
  3. Run 'dracut -f' to create a new initrd
That was all. Upon reboot I was able to run 'fstrim -a -v' to see that all of my filesystems on the SSD were trimmed. I did not have to alter my grub config to make things work; the /etc/crypttab getting copied into the initrd seemed to be the only thing necessary for me.

I did then run the commands (as root) they had to enable the timer and service:

systemctl enable fstrim.timer
systemctl start fstrim.service

With that I had things working just fine. The timer worked as expected.


No comments:

Post a Comment