[CentOS] files in a directory limitation

Michael Kress kress at hal.saar.de
Sun Nov 5 02:09:35 UTC 2006

On 11/4/2006 2:21 PM, Jim Perrin wrote:
>> Does this number vary depending on the architecture used?
> Not sure. I've only got x86 boxen to work with and test on for now.
> There is no limit (beyond inode limitations) on files on a filesystem
> or in a directory. There *is* a limit on directories in a directory.

I share your statement partly, because ...
> mkdir ~/tmp  (because doing this in an important dir is probably a bad
> idea)
> for i in {1..63000} ; do mkdir $i ; done

... this was limited up to 31998 directories in an ext3 fs.
mkdir: cannot create directory `31999': Too many links
mkdir: cannot create directory `32000': Too many links
and so on...

I tested the same thing on an xfs fs and the interesting thing was that
I got further...
Creating {1..63000} wasn't any problem,
I also added these dirs in the same directory without a prob:
for i in {1..63000} ; do mkdir abc${i} ; done
for i in {1..63000} ; do mkdir def${i} ; done
I didn't want to spend more time on testing.
It took me a whole lotta time to delete that stuff. ;-)
Maybe under xfs directories just are limited by inodes and nothing else.

Both cases, ext3 and xfs, were tested on an x86_64 (Dual xeon).

Michael Kress, kress at hal.saar.de
http://www.michael-kress.de / http://kress.net
P E N G U I N S   A R E   C O O L

More information about the CentOS mailing list