Don't Format SD cards with OS utilities!

So on Linux users may issue the command:

Linux does not correctly format SD cards. You can only depend on the SD association's formatter to place file structures correctly to line up with flash chip boundaries. This is done by placing reserved blocks in the correct places in the file system.

I use Linux but not to format SD cards.

Unfortunately the SD association's standard for formatting SD cards is only available to members. I was able to access the standard as a consultant and implemented the SdFat formatter example according to this specification.

Here are results of using mkfs.vfat, the SD Association Formatter, and the SdFat formatter

Formatted with suggested mkfs.vfat command

Volume is FAT32
blocksPerCluster: 64
clusterCount: 973729
freeClusters: 973728
freeSpace: 31907.12 MB (MB = 1,000,000 bytes)
fatStartBlock: 64
fatCount: 2
blocksPerFat: 7616
rootDirStart: 2
dataStartBlock: 15296
Data area is not aligned on flash erase boundaries!
Download and use formatter from Consumers | SD Association!

Formatted with SD Associations formatter

Volume is FAT32
blocksPerCluster: 64
clusterCount: 973584
freeClusters: 973581
freeSpace: 31902.30 MB (MB = 1,000,000 bytes)
fatStartBlock: 9362
fatCount: 2
blocksPerFat: 7607
rootDirStart: 2
dataStartBlock: 24576

Formatted with SdFat formatter

Volume is FAT32
blocksPerCluster: 64
clusterCount: 973584
freeClusters: 973583
freeSpace: 31902.37 MB (MB = 1,000,000 bytes)
fatStartBlock: 9362
fatCount: 2
blocksPerFat: 7607
rootDirStart: 2
dataStartBlock: 24576

I did more tests with Linux and Windows. I don't have a new version of Mac OS X.

Windows 7/8 does a good job of reformatting a healthy SD card. Windows just cleans the card and preserves the correct SD format.

Windows 7/8 formats an erased SD as a super floppy but if you choose the correct cluster size, file structures are aligned well. The SD standard is for an MBR volume so this is not strictly correct.

Mac OS X adds lot of non-standard hidden files and directories. I have had OS X format an SD card GPT instead of MBR which is unusable on Arduino. I don't have a machine with a new version of OS X so I can't be sure if Mac OS X still formats SD cards incorrectly.

The mkfs.vfat command suggested by pylon is the worst case. The card is not MBR and file structures are miss-aligned. This command will not work for standard SD cards (2 GB or less).