You are not logged in.

#1 2020-07-29 18:52:48

werkman2
Member
Registered: 2013-12-08
Posts: 14

enable fstrim with luks encrypted lvm

i work for a contractor where i have to carry a laptop around with sensitive client data, and after much persuading i convinced my boss to let me bring my own device.
but the only thing is, my hdd needs to be encrypted.
i have searched the forum and the wiki, but i could not find how to enable fstrim with encrypted lvm on a ssd.
even just an encrypted drive without lvm i could not get fstrim to work.
would be happy if you guys could point me in the right direction.
sorry for my bad english, its not my primary language.
in the mean time i will continue googling.
thank you for your help

Offline

#2 2020-07-29 20:23:05

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

Re: enable fstrim with luks encrypted lvm

encryption (cryptsetup LUKS) prevents TRIM by default, needs "allow discards" flag. where to set this flag depends on where/what opens the crypt container.

see for example https://wiki.archlinux.org/index.php/Dm … ives_(SSD)

LVM itself does not prevent trim/discards. Most other storage layers also don't interfere with it. cryptsetup is an exception.

Offline

#3 2020-07-31 00:23:28

werkman2
Member
Registered: 2013-12-08
Posts: 14

Re: enable fstrim with luks encrypted lvm

frostschutz, thanks for your reply, im off from work this weekend, im going to give it a try this weekend.
i normally dont like to post here because most solutions can be find via a simple google search, but this i could not find any solution.
thank you, i didnt do the "allow discard" flag, banging my head now, since i didn't think of this before.
thank you

Last edited by werkman2 (2020-07-31 00:26:57)

Offline

Board footer

Powered by FluxBB