lingon
Posts: 115
Joined: Fri Aug 26, 2011 7:31 am

SD card erase block size on your card?

Sun Jul 15, 2012 2:06 pm

Writing to flash memory is slow because data to full pages can not be written before erasing a block of pages. Writing is then possible to the newly erased pages. So in the worst case a need to write one bit of information can trigger the erasure of several pages of flash memory. For this reason it is very preferable to align the file system blocks on a flash device with the erase block size to avoid unnecessary write amplification. SD cards in a native SD card reader can report their preferred erase block size directly in Linux. Just type
cat /sys/block/mmcblk0/device/preferred_erase_size
to see the erase block size of your SD card. A smaller erase block size is of course better, because the problem with write amplification is smaller then.

My 16 GB SanDisk Extreme Pro 45 MB/s UHS 1 card reports an erase block size of 4 MB.
My 8 GB Transcend SDHC Class 6 150x card reports an erase block size of 4 MB.
My 2 GB Transcend SD 150x card reports an erase block size of 8 kB.

For USB-sticks the erase block has to be measured because the controller on the card hides this information.

It would be interesting to know the erase block size of other SD cards in use.
The size of the erase block size is not the full story on how fast a particular card is because the speed depends on the algorithm used for garbage collection and the corresponding hardware.
See the talk by Arnd Bergmann on Optimizations for Cheap Flash Media
http://free-electrons.com/blog/elce-2011-videos/

andrixnet
Posts: 1
Joined: Fri Mar 18, 2016 9:14 am

Re: SD card erase block size on your card?

Fri Mar 18, 2016 9:17 am

My SanDisk Ultra UHS-I 16GB has 4MB block size.

Would the following help and by how much?
  • aligning partitions to 4M boundaries
  • setting 4M as page size for swap partition
  • setting 4M as stride for ext4 filesystem

a14
Posts: 3
Joined: Fri Feb 13, 2015 8:27 pm

Re: SD card erase block size on your card?

Thu Sep 01, 2016 6:19 pm

My Samsung Evo+ 64GB SD card reports an erase block of 16MB. It also came preformatted (I think with exFAT) starting at 16MB.

Another card, an ICIDU (noname?) 16GB class 10 card, reports an erase block of 4MB. (Note: the company behind ICIDU has gone bankrupt now). This card performed very well when tested with iozone.

Return to “General discussion”

Who is online

Users browsing this forum: topguy and 41 guests