On Sat, Oct 05, 2019 at 06:14:24PM +0200, Pascal Hambourg wrote: > > > Is fstrim useful in suc a case ? > > > > It's disabled by default, but you can enable by setting > > "issue_discards=1" in lvm.conf, and by adding "discard" option to your > > crypttab. There's no SSD-specific mdraid configuration. > > Actually there is. mdraid and dm-raid have discard disabled by default > with RAID4/5/6 for safety reasons. One must pass the parameter > devices_handle_discard_safely=Y to the module raid456 or dm-raid > respectively to enable it.
Curious. I avoid RAID5/6 due to the old habit, but it's something that's good to go. > > > Should I add the discard option in fstab ? > > > > It's safe only if your SSD firmware is sane and does not corrupt your > > data while processing TRIM with NCQ enabled. > > For instance, some noname Chinese SSD (ADATA, for instance) can corrupt > > your filesystem in such circumstances, Samsung 850 PRO should not. > > Manual fstrim invocation seems to be safe. > > Why should fstrim be safer that the discard mount option ? AFAIK they > use the same TRIM command. The way I heard it, to trigger the corruption one should issue TRIM asynchronously *and* utilize NCQ for it. fstrim is synchronous. Reco