1

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

ext4?

dynamic
  • 730

3 Answers3

4

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.

coredump
  • 12,921
3

On ext4:

  • the subdirectory limit is 64000.
  • max number of files 4 billion (specified at filesystem creation time)
Sacx
  • 2,641
0

Well, why don't you test your machine?

#!/bin/bash

i=1
mkdir testdir || exit 1
cd testdir || exit 1

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

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).