Hacker News new | ask | show | jobs
by mikl 664 days ago
Kinda sad that a (by modern standards) slapdash file system like FAT32 is still the lowest common denominator, used for flash drives and all sorts of things. Would wish the industry could agree on using something more modern and reliable.
9 comments

Main reason that exFAT is less popular is because Microsoft still owns some of the patents on the underlying tech (but has permitted the Linux kernel access to those patents so Linux can have exFAT support). That makes it less popular for all the various pieces of niche hardware that accept microSD cards to extend storage.

Device makers that do support exFAT have to pay Microsoft for every sale. It's why for example the Nintendo Switch enables exFAT as a "system update"; that way Nintendo doesn't have to pay Microsoft for every single switch sold, only the ones that are actually using exFAT for external storage.

I think the last of those patents will expire by 2027? You'll probably see an uptick in exFAT use by then.

Patents stifle progress.
The idea of patenting a filesystem is absurd
Something where you don’t risk being hit by a Microsoft patent even when you’re not Linux?

(Also that’s still a floppy-grade filesystem, no journalling or anything.)

The industry requires a filesystem that has free and robust sample codes that runs on a 500kHz CPU with 512 bits of RAM, and Microsoft didn't provide one for exFAT, nor for NTFS, so...
IIRC, windows Mac and Linux all support R/W access to UDF as well. You can format a usb stick using that and try
For drives under 2T bytes (assuming 512-byte sectors), and the Windows behavior I’ve seen around it seems a bit strange—it takes a very long time to write out its cache before allowing you to disconnect the drive, for reasons I don’t understand.
Maybe it has legacy code related to sync an FS in a way you would do to close a session in a CDRW.
Absolutely. We don't need the most modern system to be in that spot but it'd be nice to at least have journalling...
Sad why? This industry needs to start celebrating when a technology lasts 20+ years, not feel "sad".
I'll happily celebrate standards that have stood the test of time, but FAT32 really hasn't. The 4 GB file size limit has been very painful for anything recording videos to SD cards.
I think it's quite logical. A simple filesystem with few features is obviously easier to implement.
Few features - yes. Easier to implement - absolutely not. The first sector has 9 different formats that cannot be reliably distinguished and are partially incompatible / overlapping each other: https://en.wikipedia.org/wiki/BIOS_parameter_block

And then there is the thing with the long file names extensions because FAT originally could only do 8.3 names.

I know because i tried to write a FAT driver myself.

Probably you didn't try to rewrite a ReiserFS, NTFS or other behemoths. Everything is relative.
what are the alternatives though?

NTFS? Won't work on Mac

HFS+? Won't work on Windows

EXT4? Won't work on Mac or Windows

Hence what I wrote above:

> Would wish the industry could agree on using something more modern and reliable.

There’s no techical reason why we can’t use NTFS on Macs or APFS on Windows, if the industry was willing work towards that goal together.

exFAT is generally considered the more modern replacement.
But is still legally encumbered.

FAT32 might have its limitations but it is at least small and simple enough to be implemented in a few K of boot code. That's the reason I still use it with FPGA projects.

ExFAT is a thing, but it’s less data-safe than NTFS (and than FAT32), and Linux distros might not ship drivers out-of-the-box.
Do you have details on what makes exFAT less safe than FAT32? To my understanding they should be pretty similar, at least. Obviously neither is journaling and might need the occasional fsck.
From Wikipedia <https://en.wikipedia.org/wiki/ExFAT>:

> The standard exFAT implementation is not journaled and only uses a single file allocation table and free-space map. FAT file systems instead used alternating tables, as this allowed recovery of the file system if the media was ejected during a write (which occurs frequently in practice with removable media).

ExFAT is also used by fake USB drives which claim to be much larger than they really are.

> FAT file systems instead used alternating tables, as this allowed recovery of the file system if the media was ejected during a write (which occurs frequently in practice with removable media).

This doesn't seem right to me (and the article also does not quote any source for this assertion). As far as I know, the secondary FAT is a leftover from days where block storage devices didn't have firmware-level bad block remapping, not really a consistency mechanism.

It certainly doesn't prevent inconsistencies between files/directories and the FAT, and you still need an fsck-like process to clean these up that traverses the file system when mounting a non-clean ejected FAT.

> ExFAT is also used by fake USB drives which claim to be much larger than they really are.

USB drives are block devices, and if they maliciously trick the host into assuming larger size than they actually are, that's hardly the filesystem's fault, is it?

UDF should have been a viable alternative, but as I’ve said elsewhere it only works for disks smaller than 2T bytes with 512-byte sectors, and the Windows behaviour around it seems strange.
Zfs should be installable on all three operating systems afaik though
All of those options are mountable if you install third party tooling, that's not that interesting
Installable is nice, but preinstalled is the only thing that really matters for pluggable storage devices (USB drives, DSLRs that don't use MTP/PTP etc).
ZFS. There is never a good reason not to use ZFS. That's how it got its name -- "the last word in filesystems".
But the last word in zfs is oracle.

As I heard from an anonymous friend at Apple, macOS was weeks away from announcing an official transition to zfs and then oracle bought sun.

Presumably, as a courtesy Apple asked oracle to confirm it was free to use zfs (since it was published under a permissive license). Oracle demanded money anyway. Apple blinked - not wanting to get sued by oracle. And the rest is history. A couple years later Apple wrote their own proprietary zfs like filesystem called APFS that has many similar features. And that has, to my knowledge, not been opensourced.

(It does have very detailed documentation though. Holy cow - 180 pages. https://developer.apple.com/support/downloads/Apple-File-Sys... )

I think it’s unrealistic to think that Microsoft or any embedded device vendor would have ever implemented ZFS, regardless of the patent situation.

macOS might have switched to something more modern a bit sooner than they did, but I wouldn’t be surprised if they hadn’t switched to APFS anyway after a while. Being able to independently drive your non-detachable-storage FS spec is a pretty big advantage as an OS vendor.

Well, according to my source, it would have actually happened if not for oracle. These decisions really come down to the people involved. I’m sure some people, given that choice, would never consider zfs. But some clearly would - and did.

Using an opensource filesystem like zfs doesn’t mean you aren’t in charge of your own destiny. Apple has skilled systems engineers. They could easily have made custom extensions and changes to zfs if they saw fit.

ZFS seems like massive overkill on resource-constrained embedded systems.
ZFS has a big footprint, so it could be of a problem for integrated solutions, like digital cameras needing to save images to a flash-card without having a lot of hardware power.
Sure, we should create a new standard…

https://xkcd.com/927/

Everyone should just use ReiserFS