[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fstrim and Luks / dm-raid



Le 05/10/2019 à 18:27, Reco a écrit :

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.

I want to make it clear that using this option with drives which do not read zeroes from TRIMmed sectors is unsafe.

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.

Asynchronous and synchronous to what ?


Reply to: