L1 · HardwareHow Computers Work · part 2 of 4

USB Sticks, Disks, and the Mysterious 4GB Wall

Why a 64GB USB stick refuses a 5GB file, what a file system actually is, and how FAT32, exFAT and NTFS really differ inside.

Takumi Yamada
· 8 min read
usbstoragefilesystemsfat32ntfs

You buy a 64GB USB (Universal Serial Bus) stick. You try to copy a 5GB video onto it. The computer refuses, and says the file is too large for the destination. The stick has 59 gigabytes free, and the copy fails anyway.

The obvious guesses are that the stick is broken, or that the computer is wrong about the free space. It's neither. The cause is a 32-bit number in a format designed in 1996.

In my Networking class, the professor used this example, for a good reason. Once you understand why the copy fails, you understand what a really is. So this post builds up to it step by step.

A USB stick is three things pretending to be one

A USB stick looks like one object. Inside, it has three separate parts.

USB STICKFLASH MEMORYholds the bitserased a block at a time,and it wears outCONTROLLERa tiny computerhides that, and presentsplain numbered sectorsUSB PLUGtransportmoves packets, andknows nothing of filesYOUR PC
The three parts inside the case. What your PC sees is the storage as the controller presents it.

Flash memory is the chips that actually store your . Flash works in an unusual way. You can't overwrite a small piece of it directly. You have to erase a whole block and write it again, and each part of the chip can only be erased a limited number of times before it wears out.

A controller is a tiny computer that hides all of that. It moves data around so that no part of the chip wears out early, which is called wear levelling, and it shows the flash to your computer as plain, simple storage.

The USB connection only carries data. USB itself knows nothing about files. It just moves .

Both sides of the small circuit board from inside a USB stick, each with the metal USB plug on the left. One side carries a square chip. The other side is mostly covered by one large black chip.
The board inside a USB stick, front and back. The square chip is the controller, the large black chip on the other side is the flash memory, and the metal plug is the USB interface.Photo: Ravenperch, CC0 1.0, via Wikimedia Commons (original). Changes: resized.

The controller shows your computer the basic form that all storage takes.

A block device is a giant array of numbered sectors, each typically 512 bytes. Read sector N, write sector N. That's the entire interface.

A sector is one small numbered box of storage. Your (Solid-State Drive), your hard drive, an SD card and that USB stick all look the same to the : a long row of numbered boxes.

SECTORSnumbered from 0012345…N512 bytesread sector N, write sector Nthe whole interface, for a USB stick, an SSD or a hard drive
A block device. There are no files here yet, only numbered sectors.

When you plug the stick in, it speaks the USB Mass Storage . That protocol takes the standard commands for disks, called SCSI commands, and wraps them in USB packets. Linux then gives the stick a name.

$ lsblk
NAME   SIZE TYPE MOUNTPOINT
sda  476.9G disk               ← internal SSD
sdb   57.6G disk               ← the USB stick
└─sdb1 57.6G part /run/media/you/STICK

The same and the same interface handle both. To Linux, the stick is just a very small, very slow disk.

The problem a filesystem solves

Here is the important point. A row of numbered sectors knows nothing about files. It has no names, no folders, no sizes, and no record of which sectors are free.

If you want a video file to exist, something has to decide three things. Which sectors hold its ? Where are its name and size written down? Which sectors are still free for the next file?

That system of record keeping is a file system. It isn't hardware. It's a data structure written onto the sectors, plus the code that reads and writes it. When you format a stick as FAT32 (32-bit File Allocation Table), exFAT, NTFS (New Technology File System) or ext4, you are choosing which data structure gets written onto those sectors.

THE SAME NUMBERED SECTORS, WITH A FILESYSTEM WRITTEN ONTO THEMnames0sizes1free?2free3free4free5video6video7video8video9free10photo11photo12free13the filesystem'sown bookkeepingthe bytes of one file
A filesystem is a layout for the sectors. Some hold its records, and the rest hold file contents or nothing.

And every data structure has limits. That brings us to FAT.

FAT: a linked list on a disk

FAT, short for File Allocation Table, is very old. It goes back to 1977 and Microsoft's Disk BASIC, and it was used on floppy disks, in DOS and in Windows 95. It's still used everywhere today, because it's simple.

FAT splits the disk into clusters, which are groups of sectors of a fixed size. It then keeps one big table with one entry for each cluster. Each entry answers one question: if a file uses this cluster, which cluster comes next?

Each file has a directory entry, which records its name, its size and its first cluster. From the first cluster, you follow the chain through the table.

ENTRYin the directoryvacation.mp4name12,402,881size in bytes7first clusterFATone entry per cluster5free6free798free910101211free12EOFvacation.mp4 = clusters 7 → 9 → 10 → 12
The directory entry says where the file starts. The table says where it goes next.

That's the whole design. It's a linked list, a chain where each item says where the next one is, and all the "next" links are kept in one table.

The 12, 16 and 32 in FAT12, FAT16 and FAT32 are the size in bits of each table entry. Bigger entries can point to more clusters, which means bigger disks. FAT32 came with an update of Windows 95 in 1996, when a 2GB hard drive was considered huge.

The 4GB wall, exactly

Now back to the example from my Networking class. Look at the directory entry, the record FAT32 keeps on the disk for every file. It's exactly 32 bytes.

attributesname11 bytestimes and first cluster16 bytessize4 bytes011122832largest value4,294,967,295
All 32 bytes, to scale. The size has to fit in the last four.

The file's size is stored in 4 of those bytes, as an unsigned 32-bit whole number. The largest number 32 bits can hold is 4,294,967,295. As a file size in bytes, that's 4 GiB minus one byte.

That's the whole explanation. There's no room in a FAT32 directory entry to write a bigger number. It doesn't matter how much free space the stick has. The file system can't record a file larger than that, so the operating system refuses before it writes a single byte.

Two details are worth noting.

It's a limit for each file, not for the disk. A FAT32 disk can be up to 2TB and hold thousands of files, as long as each file stays under the limit.

Nobody expected it to matter. In 1996, a 4GB file seemed absurd, and most hard drives were smaller than that. Many limits in computing went the same way, including 32-bit IP (Internet Protocol) addresses and 32-bit Unix time. They were more than enough when they were designed, and a real limit twenty years later, once a single movie or game update was bigger than 4GB.

The fix is to use a file system with a bigger size field. That's exactly why the others exist.

NTFS: the grown up filesystem

NTFS came with Windows NT in 1993. It was designed for , and it's built very differently from FAT.

Instead of one table of "next cluster" links, NTFS is built around the Master File Table. Every file has a record there. The record describes the file's clusters as extents, which are ranges such as "start at cluster 9 and continue for 2 clusters". That's much shorter than a chain you follow one cluster at a time.

FATfollow every link56789101112NTFSjust ranges56789101112start 7,length 1start 9,length 2start 12,length 1
One file in four clusters. FAT stores a link for every cluster, and NTFS stores one entry for each run.

On top of that, NTFS adds the features FAT never had.

64-bit file sizes. The real limits for files and disks are in the hundreds of terabytes. The 4GB wall doesn't exist.

Journaling. Before NTFS changes its records, it first writes what it's about to do in a log, called a journal. If the power goes off in the middle of a change, NTFS reads the log the next time it starts, and finishes or cancels the change. It never stays half done. FAT has nothing like this. That's why pulling out a FAT stick at the wrong moment can leave its records in a mess, and it's what "safely remove" warnings and disk-checking tools are really about.

FATno journalCHANGE, HALF DONEpower lostleft half updatedNTFSthe log comes firstLOG THE PLANCHANGE, HALF DONEpower lostREAD THE LOGAt the next mount, the log says what was in progress, and the change is finished or undone.
The same power loss on FAT and on NTFS.

Permissions. Every file has a list that says who may read it, change it and run it. FAT has no idea of an owner at all. That's why every file on a USB stick seems to belong to whoever plugged it in.

NTFS also adds compression, , and other features.

So why isn't everything NTFS? Because of compatibility. NTFS belongs to Microsoft, and it's complicated. Cameras, TVs, car stereos and printers mostly can't write to it, and macOS can read it but can't write to it without extra software. FAT32 is so simple that almost every device supports it.

exFAT: the peace treaty

For removable storage there is an option in the middle. exFAT, from 2006, keeps the simplicity of FAT, with no journal and no permissions, but makes the size fields 64 bits wide.

FAT32the size field12344 byteslargest file: 4 GiB minus one byteEXFATthe size field123456788 byteslargest: about 17 billion GiB
The field that caused the limit, and the wider one that removed it.

The 4GB limit is gone. Microsoft made exFAT part of the SD card standard, and later it was added to the Linux . Today it's the default on every SDXC card and on most large USB sticks.

Here is the whole comparison in one table.

FAT32exFATNTFS
max file size4 GiB minus 1effectively unlimitedeffectively unlimited
journalingnonoyes
permissionsnonoyes
works everywhereyesalmostWindows, mostly
best forsmall sticks, EFI boot big sticks, SD cardsWindows internal drives

Linux computers use their own file systems, such as ext4, btrfs and xfs. These also have journals and permissions, and the same reasoning applies to them.

Try it yourself

On Linux, you can see all of this happen with a spare stick. These commands erase the stick, so check its device name with lsblk first.

$ sudo mkfs.vfat -F 32 /dev/sdb1        # format as FAT32
$ mount | grep sdb1
/dev/sdb1 on /run/media/you/STICK type vfat (...)

$ fallocate -l 5G bigfile
$ cp bigfile /run/media/you/STICK/
cp: error writing '.../bigfile': File too large    ← the 32-bit wall

$ sudo mkfs.exfat /dev/sdb1             # reformat as exFAT
$ cp bigfile /run/media/you/STICK/      # works fine

The same stick, the same free space and the same file. The only thing that changed is the data structure written onto the sectors.

Wrapping Up

A USB stick, an SSD and a hard drive all look the same to your computer: a numbered row of sectors. USB is only the way the data travels.

A file system is a data structure on top of those sectors. It creates the idea of files, names, folders and free space.

FAT32 stores each file's size in a 32-bit field, so no file can be bigger than 4 GiB minus one byte. That limit is built into a 32-byte record designed in the 1990s.

NTFS replaces FAT's chains with the Master File Table and extents. It adds a journal, permissions and 64-bit sizes, but fewer devices can use it.

exFAT is FAT with 64-bit sizes, and it's the practical choice for anything you plug in and remove.

The next time a copy fails while there are gigabytes of free space, you will know the stick isn't broken. The cause is a field that's four bytes wide.

Check yourself

3 questions · nothing is saved
  1. 1.What is a file system?
  2. 2.A FAT32 stick has 59 GB free, yet a 5 GB file won't copy. Why?
  3. 3.What does a journal, as in NTFS, protect against?

Who wrote this

Author profile and background

Takumi Yamada

Takumi Yamada

· Backend Engineer

Backend engineer building services, databases, Linux tooling, and NEGEN SYSTEMS. Writing about low-level mechanics, distributed systems, and real-world security.

End of post
NEGEN SYSTEMS
Receipt · post 26 of 31
Written
Jul 19, 2026
Length
1,733 words · 8 min
Built
…
Served by
…
Delivered
…
Over the wire
…
Go's share
…
Next in How Computers Work · part 3 of 4

How Linux Boots: From Power Button to Login

Firmware, bootloader, kernel, initramfs, PID 1: the chain of programs that runs between pressing the power button and seeing a login screen.

6 min read