Products > Embedded Computing

Do SD cards handle wear leveling on their own?

<< < (3/4) > >>

Nominal Animal:
I don't think it is so much a question of wear leveling or not, but what kind of wear leveling is implemented.

I suspect the industrial/heavy use ones have a separate per-sector counters and indirection, whereas the consumer ones that do have wear leveling use very simple algorithms with best-guess wear leveling without spending any extra resources on it.  I do believe almost all SD cards have minimal wear leveling, perhaps some kind of linear congruential rotation of the sectors written, whose benefits vary depending on the use patterns from nil to excellent; which is why users have different experiences with the same card/series/manufacturer just by using a different hardware, file system, or OS version or firmware.  Even minimal differences in (relative) timing can affect the effectiveness of such algorithms (because it affects the order in which sectors get modified).

This is a very annoying thing when trying to run an SBC off an microSD card, because manufacturers don't describe what kind of wear leveling they use, and it's almost impossible to tell whether their expected write cycle counts (TiB or per-sector) are realistic or just marketing wank.

In my experience, if you mount the card mostly read-only, they'll survive much longer; but for anything that needs more than occasional I/O, I use eMMC or SSD.  If the SBC cannot boot off eMMC or SSD directly, then I use an SD card for the initial boot only.

Now that SBCs tend to have have USB 3, and there are cheap-but-okay USB-SATA controllers (I use a cheap Jmicron one on one of my SBCs), a small 240G SATA SSD (costs 30-40€ here) is an excellent substitute to those SD cards; and price range is similar to much smaller capacity industrial SD cards.  The SSDs take a lot more room, of course, and consume somewhat more power, but the reliability is so much better compared to what luck I've had with SD cards, it's worth it to me.

I wish there was reliable info on the reliability/wear leveling of various SD cards, though.  Sometimes one does have to use an SD card.

David Hess:

--- Quote from: RoGeorge on November 20, 2021, 03:15:46 am ---Can you give an example of SD card without wear leveling, or how did you know they don't have it, please?
--- End quote ---

People have run tests by writing data to the same sector repeatedly, and the SD cards without wear leveling failed in short order consistent with the write endurance of a single Flash page.

Some cards were also found to rely on the file system structure. so for instance they might only wear level the FAT area, and do nothing at all with NTFS or whatever.

Rasz:

--- Quote from: David Hess on November 20, 2021, 08:31:28 pm ---People have run tests by writing data to the same sector repeatedly, and the SD cards without wear leveling failed in short order consistent with the write endurance of a single Flash page.

Some cards were also found to rely on the file system structure. so for instance they might only wear level the FAT area, and do nothing at all with NTFS or whatever.

--- End quote ---

Citation needed

Rerouter:
Currently have a lot of old SD cards on my desk out of video records, , many of them have lost capacity from there original size, I doubt they have wear leveling, instead the device has to handle it and the diagnostics gives us information indicating its the one keeping the bad block table, many of them have many faulty blocks as that is why they where replaced and I ended up with them. though the capacity loss is the interesting part,

cfbsoftware:

--- Quote from: SiliconWizard on November 20, 2021, 01:27:42 am ---I've read some claims that the WD purple cards do wear leveling, but no official statement from WD.

--- End quote ---

FYI the following quotes related to the WD purple cards are included in this article:

https://www.reddit.com/r/raspberry_pi/comments/ex7dvo/quick_reminder_that_sd_cards_with_wearleveling/


--- Quote ---Got the answer today (12 Feb 2020):


--- Quote ---This is the statement I got back from Engineering regarding the wear leveling inquiry:

Our WD Purple MicroSD's do both static and dynamic wear-leveling. Meaning all blocks across whole address space are considered for wear leveling regardless of if and how the blocks are used. This keeps the number of program erase cycles consistent on all blocks.
--- End quote ---

So yes, these cards have proper wear-leveling according to WD. Which is nice to have confirmed directly from the manufacturer.
--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version