fedora-silverblue / issue-tracker

Fedora Silverblue issue tracker
https://fedoraproject.org/atomic-desktops/silverblue/
123 stars 3 forks source link

Enable fstrim on LUKS encrypted partitions #31

Open hferreiro opened 4 years ago

hferreiro commented 4 years ago

Apparently, the Silverblue edition, in contrast with Workstation, is missing /etc/crypttab in the initramfs, preventing the trimming of the root and home partitions: https://bugzilla.redhat.com/show_bug.cgi?id=1801539.

tpopela commented 4 years ago

There are several ways of how to achieve it mentioned in the bug:

rpm-ostree initramfs --enable --arg=-I --arg=/etc/crypttab but this will rebuild the initramfs on each new deployment.

or

You can just add rd.luks.options=discard to the kargs. That way rpm-ostree doesn't have to rebuild the initramfs on each new deployment. You can do that by rpm-ostree kargs --append=rd.luks.options=discard

the question is though whether we should do this automatically after we enabled it for Fedora Workstation in 32+ - https://fedoraproject.org/wiki/Changes/EnableFSTrimTimer

hferreiro commented 4 years ago

Thanks, I was aware of those options, I just wanted to bring it to your attention so that this works by default from F32 onwards.

A6GibKm commented 4 years ago

When I run systemctl start fstrim.service with rd.luks.options=discard enabled my home is not being trimmed on a system with LUKS 1, but it is trimmed on my machine with LUKS 2. Is this normal?

EDIT: For some reason the discard option was missing in /etc/crypttab on my LUKS1 machine.