Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know of fat32 being of 65.000 files per dir, what about linux/debian?


share|improve this question
@sven: there isn't any answer in that question to how many files ext4 can handle per dir – dynamic Mar 17 '11 at 21:21
up vote 3 down vote accepted

It depends on your filesystem. Ext3 has the following limits:

  • Maximum number of sub-directories: 32000 (hardcoded)
  • Maximum number of inodes (maximum number of files and directories on the whole system): the default is calculated based on the volume size in bytes (default number of inodes = V/2^13)

Other filesystems will have different limits, some will limit files inside a dir while others don't. Refer to your filesystem documentation for more info.

You can see some Ext4 limits on this question.

share|improve this answer
debian 6 uses ext4 (what i am interested about) anyway +1 – dynamic Mar 17 '11 at 21:26
@yes check my comment – coredump Mar 17 '11 at 21:30
ok! df -i shows how many free inode are left, what i wanted (atm i have 44mil inode free, i have some margin xD) – dynamic Mar 17 '11 at 21:40
@yes yes unless you are running a mailserver with Maildir store, no spam filtering and millions of users, you are ok :P – coredump Mar 17 '11 at 23:25

On ext4:

  • the subdirectory limit is 64000.
  • max number of files 4 billion (specified at filesystem creation time)
share|improve this answer
max number of files 4 billion per directory? or 4bil per entire filesystem? – dynamic Mar 17 '11 at 21:38

Well, why don't you test your machine?


mkdir testdir || exit 1
cd testdir || exit 1

while true
  [ $(($i % 1000)) -eq 0 ] && echo "creating file $i"
  touch file.$i || { echo "failed to create file.$i"; exit 1; }

Please, please don't run that on a production server. The system could become very sluggish as it creates massive numbers of files.

Also note that deleting a directory full of many, many thousands of files could also take a very long time (like hours).

share|improve this answer
This is an overkill. Somewhere in ext4 specs should be known – dynamic Mar 17 '11 at 21:23
Don't do that, you may end doing a kind of a DDOS on a machine, and depending on the FS you may end using ALL the available inodes. – coredump Mar 17 '11 at 21:24
And by DDOS I mean DOS. – coredump Mar 17 '11 at 21:31
Oh heck you guys, it's just a fun experiment to run. I clearly say don't do it on a production server. Specs are fine but it's always useful to experiment as well. Also note that some filesystems get massive performance problems above a certain number of files per dir, this is a good way to detect that. – Phil Hollenback Mar 17 '11 at 21:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.