On 21/01/2019 19.51, Andrei Borzenkov wrote:
21.01.2019 13:52, Carlos E. R. пишет:
On 21/01/2019 05.01, Andrei Borzenkov wrote:
21.01.2019 0:17, Carlos E. R. пишет:
On 20/01/2019 20.15, Andrei Borzenkov wrote:
20.01.2019 22:11, Matthias Bach пишет:
...
OK this is consistent. I assume you are using Leap 15 with current kernel or TW?
Yes, those two use 15.0 with default kernel.
Should I?
I guess it is up to you - whether you want to actually use TRIM or not.
I'm confused with discard vs trim. I understand that "discard" is simply the option word in fstab.
Discard is kernel framework for passing information about unused areas to storage device. Final device driver translates these requests into device-specific commands. TRIM is one such command used by (S)ATA devices. SCSI has UNMAP and some other; NVMe has Deallocate.
TRIM is often used colloquially to mean "free unused space on device".
All drivers involved in request processing must support and allow discard requests. This is exactly what "allow_discard" dm-crypt option does; so even though your physical devices claim to support discards (using whatever dialect they speak) those requests will be ignored by crypto-container and never reach your physical device.
Filesystem "discard" option makes it issue discard requests when space is freed (like when file is deleted). Low level drivers are still free to ignore these requests.
I have trim periodically on the filesystem instead of online, I think I prefer it that way.
And this thread made me think whether encrypted partitions should be handled differently. Do the periodic trim work on the encrypted filesystem? If it does, then I'm fine.
Your encrypted devices (or better underlying physical devices) are never trimmed unless you explicitly allow it.
Let me see if I understood. On an encrypted partition, if /etc/crypttab has "allow_discards", trim will happen when the trim cronjob runs, or online via option in fstab.
Reading here:
https://wiki.debian.org/SSDOptimization
Says:
«The "discard" options is not needed if your SSD has enough overprovisioning (spare space) or you leave (unpartitioned) free space on the SSD.»
which is my case.
In this case you do not need manual fstrim as well. You still use it.
-- Cheers / Saludos, Carlos E. R. (from 15.0 x86_64 at Telcontar)