Topic: It might be better to leave your SD card / USB flash drive factory formatted.  (Read 833 times)

0 Members and 1 Guest are viewing this topic.

gbrao

  • Chef
  • ***
  • Date Registered: Sep 2011
  • Posts: 176
I routinely formatted the USB flash drives I got without a second thought. I recently got a (my first) microSD card to use with my smart phone. I was trying to find the "best" way to format the card when I came across this : http://wiki.laptop.org/go/How_to_Damage_a_FLASH_Storage_Device

Quote
...
 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.
...
 How to win

It boils down to the fact that you need to micro-manage a lot of details to ensure that things fall on suitably-aligned boundaries. You need to consider both the partition map and the filesystem layout in concert. One way to separate the problems is to make each partition begin on an erase block boundary, then layout the filesystems so their subordinate data structures (particularly the cluster or "fs block" array) fall on erase block boundaries assuming that the partition itself begins erase-block-aligned. What is a good alignment boundary? Well, 256 KiB is good for most new chips, but to give some breathing room for the future, maybe 1 MiB would be better - or perhaps even 4 MiB.

Better yet, try to avoid reformatting FLASH-based devices when you have the choice.
...

If you just have to format a SD card use this : https://www.sdcard.org/downloads/formatter_4/
« Last Edit: August 20, 2015, 11:08:16 PM by gbrao »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 6722
Thanks  gbrao,


Sharing my experience:
Some years ago,
I decide to prepare sd card to my phone on windows,
and failed with all applications,
when windows can accesss, phone can not, when phone can access windows can not etc... (win8)
and other similar troubles
....

Finally, I decide to format sd card with phone's format too  :great:
and decide not to remove this sd card again from phone  :lol:
never plug in to windows again  :wink:
No need to,
ftp server is fast enough,
I mostly use Ftp Server from The Olive Tree
http://theoven.org/index.php?topic=343.0


:turtle:

 

Powered by EzPortal