Mortimer wrote:I still can't see that there is any advantage to writing zeros to an unwanted block. Having it marked for deletion should be enough, and use up the block next write cycle count for writing wanted data to it when the time comes. Wanting to write zeros to a block that is no longer wanted will in my mind effectively double the wear rate across the whole device.
As long as the SD card does not know that the block is free, the SD card controller's wear leveling can't use it.
This basically means the file system takes control over which block gets rewritten and this might wear blocks earlier than necessary.
Take the following example:
You've been using your SD-card for months and have done a lot of writes to it. It might even have been almost full at one time, meanig all blocks have some sort of data on them, even if the card is only half full.
Now you have a program that updates a file quite often. This means that for each write of this file, the same flash block gets written again and again, because the wear leveling pool is empty.
I know this is a very extreme case, but I'm trying to make a point here.
Now if you could tell the SD card that you're not using half of it's blocks, it can use a new block for each write and wear many blocks very little instead of wearing one block a lot.
And this is actually a real problem. I mean why would SSDs support a dedicated command (TRIM) for this if it wouldn't matter?