[buug] linux filesystem limitations

Jon McClintock jammer at weak.org
Tue Apr 15 17:33:33 PDT 2003

On Tue, Apr 15, 2003 at 04:16:23PM -0700, Nick Jennings wrote:
> hello, I was wondering if anyone here knew the maximum number of
> file/directory entries that can exist inside of one directory?
> I think it's 32k, is this correct? Has there been any increases in this
> limitation as of yet?

 From Documentation/filesystems/ext2.txt:

There is an upper limit of 32768 subdirectories in a single directory.

There is a "soft" upper limit of about 10-15k files in a single directory
with the current linear linked-list directory implementation.  This limit
stems from performance problems when creating and deleting (and also
finding) files in such large directories.  Using a hashed directory index
(under development) allows 100k-1M+ files in a single directory without
performance problems (although RAM size becomes an issue at this point).

The (meaningless) absolute upper limit of files in a single directory
(imposed by the file size, the realistic limit is obviously much less)
is over 130 trillion files.  It would be higher except there are not
enough 4-character names to make up unique directory entries, so they
have to be 8 character filenames, even then we are fairly close to
running out of unique filenames.

...and now you know... :)


More information about the buug mailing list