First of all, the SD Card alignment refers actually to the Cluster Alignment
Why Is Cluster Alignment Important?
Flash memory cards are random access media with a sector size of 512 bytes. But this is only a logical representation. Flash memory can be read out byte-by-byte, but it has to be erased before writing. The erase procedure acts on a whole memory page that is erased within a "flash", hence the name flash memory. Even if you only want to change a single bit, one page has to be read out, flashed, and written back with the modified data. The page size is a power of two equal to or larger than the sector size of 512 bytes, in most cases a value from 4kB to 32kB based on my observations.
If you’re already bored and you want to know how to align your SD Card, go here
If the write size is smaller than the page size, the whole page has to be flashed and written back. If a write operation crosses a page boundary, then two pages have to be read, flashed and written back. The flash card controller could combine consecutive unaligned writes to a series of aligned writes, but there seem to be controllers in use where the write performance suffers from such unaligned writes.
For cards other than CompactFlash, there seem to be certain rules how the card should be formatted. The following list is based on detailed analysis of the file systems of about one hundred memory cards. I don’t have access to the documents, these seem to be only available for members of the respective card association.
This means that you get the best performance, if Cluster 2 (the first cluster in the file system) is aligned to a page boundary, and the cluster size is equal to or an integer multiple of the page size.
Due to the card size register layout, most SD cards could be mapped to C/16/32, but the partitions are usually mapped to LBA with C/255/63 and in most cases with an odd partition end (i.e. no cylinder boundary). The partition start is set to a certain value so that the Cluster 2 starts at address 0×40000, 0×50000 or 0×60000 in most cases, i.e. at a 64kB boundary.
If you found this interesting, please don't forget to like/share it. Like the page too, in order to receive all the updates in Facebook.
You might also like: