You are not logged in.

#1 2019-06-30 07:36:28

Simaryp
Member
Registered: 2018-04-28
Posts: 153

TRIM with LVM on LUKS

Hi,

I have my system on a LVM inside a LUKS container and so far didn't specify trimming of the SSD as I think on other systems that was enabled on default.

$ lsblk --discard shows me that the unencrypted boot and efi partition is trimmed, but the system partition not.

From the wiki I read two things that to get continous TRIM I could add discard to fstab, but with LUKS I should add :allow_discard to the cryptdevice booting parameter.

I wonder now whether I would need to do both or whether one of the two is sufficient, since the statements are not mentioning the combination of LUKS and LVM especially.

Offline

#2 2019-06-30 07:55:55

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: TRIM with LVM on LUKS

You only need allow_discards for the LUKS layer. All other layers allow TRIM without doing anything.

For TRIM to actually be performed, you can run fstrim when you feel like it, or automate it with fstrim.timer in a weekly cycle.

Offline

#3 2019-06-30 08:08:03

Simaryp
Member
Registered: 2018-04-28
Posts: 153

Re: TRIM with LVM on LUKS

Thanks.

Offline

Board footer

Powered by FluxBB