You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
Unfortunately SDFormatter isn't available for Linux so i made this. It is a tool to format your SD card the way the SD Association intended but under Linux.
3
3
4
4
Multiple SD cards with different capacities have been tested and this tool formats them 1:1 the same as SDFormatter with the following exceptions:
5
-
* SDFormatter does not set the jmp instruction offset in the boot sector. sdFormatLinux does.
6
-
* sdFormatLinux does not support exFAT right now.
5
+
* SDFormatter does not set the jmp instruction offset in the boot sector for FAT12/16/32. sdFormatLinux does.
6
+
* For exFAT sdFormatLinux clears unused FAT entries SDFormatter leaves untouched and SDFormatter clears more areas after root directory cluster. As far as i can tell these differences don't matter.
7
+
* sdFormatLinux currently does not preserve OEM flash parameters when reformatting in exFAT. It will recalculate the correct values instead.
7
8
8
9
## Examples
9
-
Erase (TRIM) and format SD card (recommended). TRIM will not work with USB card readers and is ignored.
10
+
Erase (TRIM) and format SD card (recommended). TRIM will not work with USB card readers and is ignored if used with one.
10
11
`sudo sdFormatLinux -e trim /dev/mmcblkX` where X is a number.
u32 fatLength; // Minimum "(ClusterCount + 2) * 2^2 / 2^BytesPerSectorShift" rounded up to nearest integer, maximum "(ClusterHeapOffset - FatOffset) / NumberOfFats" rounded down to nearest integer.
23
24
u32 clusterHeapOffset; // Minimum "FatOffset + FatLength * NumberOfFats", maximum "2^32 - 1" or "VolumeLength - (ClusterCount * 2^SectorsPerClusterShift)" whichever is smaller.
24
-
u32clusterCount; // Shall be the lesser of "(VolumeLength - ClusterHeapOffset) / 2^SectorsPerClusterShiftrounded down to the nearest integer" or "2^32 - 11". Recommended no more than "2^24 - 2".
25
+
u32 clusterCount; // Shall be the lesser of "(VolumeLength - ClusterHeapOffset) / 2^SectorsPerClusterShift rounded down to the nearest integer" or "2^32 - 11". Recommended no more than "2^24 - 2".
25
26
u32 firstClusterOfRootDirectory; // Minimum "2", maximum "ClusterCount + 1".
26
27
u32 volumeSerialNumber; // Volume serial number generated from date and time.
27
28
u16 fileSystemRevision; // versionHigh<<8 | (u8)versionLow. Version high 1-99, versionLow 0-99. Usually 1.00.
@@ -35,16 +36,99 @@ typedef struct
35
36
u8 bootCode[390]; // Bootstrapping code or 0xF4 filled (x86 halt).
0 commit comments