You are not logged in.

#1 2019-01-24 23:17:50

slarti
Member
Registered: 2019-01-24
Posts: 6

Is TRIM working correctly on my dm-crypt setup?

After some years of running Fedora I'm returning to Arch smile

My SSD setup is the following:
/boot partition (boot manager is systemd-boot)
/ partition (encrypted with dm-crypt using LVM)

After running

fstrim -v /

returned an error because discards are disabled by default when dm-crypt is used I added

:allow-discards

to the systemd-boot cryptdevice entry in the loader config. After that fstrim seems to work and the output is that it trimmed ~450GB (the whole free disk space). If I rerun it directly it says it trimmed 0 bytes. But if I run fstrim after a reboot it again trims ~450GB. Is this normal behaviour or do I miss some further configuration? It seems a bit odd that it will trim so much data every time I boot the machine.

Last edited by slarti (2019-01-27 13:03:03)

Offline

#2 2019-01-24 23:48:37

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

Re: Is TRIM working correctly on my dm-crypt setup?

It's normal, depends on the filesystem.

These questions come up frequently, I've posted my take on things on unix stackexchange, some links for you:

https://unix.stackexchange.com/a/371665/30851 - regarding the size reported by fstrim

https://unix.stackexchange.com/a/218083/30851 - regarding how often to run fstrim

https://unix.stackexchange.com/a/85880/30851 - regarding how to test if fstrim really works

Offline

#3 2019-01-27 13:02:46

slarti
Member
Registered: 2019-01-24
Posts: 6

Re: Is TRIM working correctly on my dm-crypt setup?

Thank you. Good to hear it's nothing to worry about (at least in some cases) smile

I'm using ext4 on my root partition, so it's still maybe a little strange. I'll have to check if fstrim really works.

Offline

Board footer

Powered by FluxBB