msdosfs vs 250Gb hard disk

David Schultz das at FreeBSD.ORG
Fri May 2 08:36:37 PDT 2003


On Fri, May 02, 2003, Daniel O'Connor wrote:
> On Fri, 2 May 2003 13:24, David Schultz wrote:
> > Most filesystems have a unique identifier associated with every
> > file, but msdosfs does not.  The FreeBSD driver invents inumbers
> > on the fly as the index of the directory entry for the file,
> > assuming that the entire disk is full of directory entries.  These
> > numbers are 32 bits and they need to be persistent, so it would
> > not be possible to play any clever tricks with the math.
> 
> I don't think FAT32 can have 4 billion files..? I understand your point about 
> the limitations of the inode number synthesiser, but I was hoping someone 
> with more knowledge of how FAT works to be able to give some hints :) :)

The problem is that virtually any sector on the disk can be used
for directory entries.  You can't have the inumbers for existing
files changing every time you create a new file, and you can't
have two files with the same inumber.  There are insufficient
unused fields in the DOS directory entry to record the persistent
state you would need to somehow allocate inode numbers in an
intelligent way, so you're kinda stuck unless you (for instance)
invent a special file to keep track of the information, and write
to it all the time.  The short of it is that it's a hard problem
to solve.  FreeBSD's msdosfs implementation mainly exists for
compatability; it isn't supposed to be amazingly robust, and no
implementation of msdosfs can be.  So basically, you're stuck with
sub-128GB drives if you want to use FAT32.  :-(


More information about the freebsd-stable mailing list