linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What if TRIM issued a wipe on devices that don't TRIM?
@ 2018-12-06  6:11 Robert White
  2018-12-06  6:26 ` Roman Mamedov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert White @ 2018-12-06  6:11 UTC (permalink / raw)
  To: Btrfs BTRFS

(1) Automatic and selective wiping of unused and previously used disk 
blocks is a good security measure, particularly when there is an 
encryption layer beneath the file system.

(2) USB attached devices _never_ support TRIM and they are the most 
likely to fall into strangers hands.

(3) I vaguely recall that some flash chips will take bulk writhes of 
full sectors of 0x00 or 0xFF (I don't remember which) were second-best 
to TRIM for letting the flash controllers defragment their internals.

So it would be dog-slow, but it would be neat if BTRFS had a mount 
option to convert any TRIM command from above into the write of a zero, 
0xFF, or trash block to the device below if that device doesn't support 
TRIM. Real TRIM support would override the block write.

Obviously doing an fstrim would involve a lot of slow device writes but 
only for people likely to do that sort of thing.

For testing purposes the destruction of unused pages in this manner 
might catch file system failures or coding errors.

(The other layer where this might be most appropriate is in cryptsetup 
et al, where it could lie about TRIM support, but that sort of stealth 
lag might be bad for filesystem-level operations. Doing it there would 
also loose the simpler USB use cases.)

...Just a thought...

--Rob White.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-07 12:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  6:11 What if TRIM issued a wipe on devices that don't TRIM? Robert White
2018-12-06  6:26 ` Roman Mamedov
2018-12-06 10:04 ` ronnie sahlberg
2018-12-06 13:04 ` Austin S. Hemmelgarn
2018-12-07  4:09   ` Andrei Borzenkov
2018-12-07 12:18     ` Austin S. Hemmelgarn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).