On Mon, Dec 26, 2022 at 09:26:58PM +0100, Nicolas George wrote:
> Tixy (12022-12-26):
> > He didn't mention filesystems.
> > 
> > The controller in the card would surely know what flash blocks contain
> > data, so writing the whole card first would reserve those blocks as
> > 'in-use' leaving just a relatively small amount of spare blocks which
> > would be available for erasure and reuse the that repeated write.
> 
> Unless the card is brand new, “what flash blocks contain data” is “all
> of them”. The information whether a block is used or not used resides in
> the filesystem data structures.

It's more complicated than that. Making a file system doesn't write
to all blocks at the beginning. Unless you zero the whole disk before,
which takes significantly longer than just doing "mkfs.foo /my/device".

Then, some controllers even special-case the "all zeros to a block"
as "mark unused", so if you want to get extra sure, you'd have to
write random data to your device (that's what you do if you make an
encrypted file system and don't want your opponent to see which
blocks have been written).

Last time I tried, that took quite some time for my 1G (spinning
rust, admittedly) drive.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature

Reply via email to