FAT32 over 2TB - USB vs SATA

Triangle

FAT32 over 2TB - USB vs SATA

A number of years ago I started setting up a DIY NAS, before that I simply had a stack of external hard drives. At the time I switched a lot between Linux and Windows, the NTFS support wasn’t great and since life is too short to remove devices safely I usually just unplugged them causing Linux to refuse to mount since “the partition was still active”. So FAT32 it was…

After a while I upgraded from a Raspberry Pi (1B) to an actual small PC/server with a bunch of drives. This entails removing the drives from their casing and building them into the case, in other words, switching from USB-SATA interface to SATA directly and that’s where the issue lies… So whenever I build in the drive and tried to mount it, it would show up empty… connecting it (back again) via USB, and it would be just fine…

After a lot of googling and reading/refreshing my memory about sectors, cylinders and heads, all the beautiful stuff I thought I left in the 90s, I noticed the sectors size being 4096 bytes…

But on wikipedia…

The FAT32 boot sector uses a 32-bit field for the sector count, limiting the maximal FAT32 volume size to 2 terabytes with a sector size of 512 bytes1

So where does the 4096 byte sector size come from…???? Well… as it turn out… USB… this “upgrades” certain values automagically enabling me to format a drive, via USB, as FAT32, with more than 2TB. Somehow the usb interface makes it that the sector size automagically convert from 512 to 4096.

That’s it… and it what kept me wondering for (admittedly) way way way too long…