http://wiki.laptop.org/go/How_to_Damage ... age_DeviceQuote:
This page tells you how to degrade the performance and reliability of FLASH-based storage devices like SD cards and USB drives (pendrive, etc). And by implication, how not to damage them.
...
Putting it Together
How is the filesystem layout relevant to our problem? Allocation data accesses are very common, as are cluster-sized data writes. So we want those operations to be efficient. If the allocation data starts on a NAND FLASH page boundary, a given allocation map write is less likely to span two pages, so the FTL gets to do things the "easy" way, which is faster and causes less NAND wear. If the cluster size is a power-of-two multiple of the NAND FLASH page size and the first cluster is aligned on an erase block boundary, cluster writes are similarly "easy".
Conversely, if the layout is bad, every cluster write might "split" two pages, forcing the FTL to perform four internal I/O operations instead of one.
Factory formatting
The manufacturers of FLASH storage devices understand this. When they format the device at the factory, they know which filesystem they are putting on (typically either FAT16 or FAT32), the page and erase sizes for the NAND FLASH chips inside, and the characteristics of the FTL software in the internal microcontroller. (Actually, there is yet another factor - multiple NAND chips or multi-plane chips can further influence the locations of "efficient" boundaries.) Knowing this, they can choose a layout that encourages "easy case" internal operations.
Here is how the factory formatted my Toshiba flash drive.
From the boot sector ...
Code:
Reserved Sectors 624
Bytes per Sector 512
Sectors per Cluster 64
Big Sectors per FAT 3816
These are the locations and sizes of the various components of the FAT32 file system:
boot sector at LBA:8064
624 reserved sectors
FAT#1 at LBA:8688 (= 8064 + 624)
FAT#2 at LBA:12504 (= 8688 + 3816)
root dir at LBA:16320 (= 12504 + 3816)
The boot sector begins on a 32KB boundary (8064 / 64 = 126).
The root directory also begins on a 32KB boundary (16320 / 64 = 255).
The cluster size is 32KB (= 64 x 512 bytes).
It appears that the manufacturer has inserted 624 reserved sectors between the boot sector and FAT#1 (rather than the usual 32 for a HDD) so that the root directory is aligned.