
On Thu, May 14, 2020 at 02:10:26PM -0400, D. Hugh Redelmeier via talk wrote:
If you use fstrim on a filesystem, what happens when a dd accesses an unallocated block? Is that well-defined? An I/O error? Are all unallocated blocks identical? Is this up to the manufacturer or some standard?
(I'm too lazy or too busy to experiment.)
According to wikipedia the ATA standard allows choices: There are different types of TRIM defined by SATA Words 69 and 169 returned from an ATA IDENTIFY DEVICE command: 1) Non-deterministic TRIM: Each read command to the Logical block address (LBA) after a TRIM may return different data. 2) Deterministic TRIM (DRAT): All read commands to the LBA after a TRIM shall return the same data, or become determinate. 3) Deterministic Read Zero after TRIM (RZAT): All read commands to the LBA after a TRIM shall return zero. Apparently 1 is pretty much only seen on budget garbage drives 2 is most common on consumer SSDs 3 is most common on enterprise SSDs and required by many NAS systems if you want to run RAID on the drives. -- Len Sorensen