CentOS Number of Files Per Directory

deklinm
deklinm used Ask the Experts™
on
Is there a maximum number of files that can be stored in a single directory on a CentOS 5.8 Server?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Top Expert 2013

Commented:
Here is an excellent article on that topic:

http://www.frank4dd.com/howto/various/maxfiles-per-dir.htm
Which file system are you talking about?  Most frequent file system used in CentOS 5.8 is ext4 but xfs and other file systems are pretty frequent as well.

It allows 64000 sub directories per directory
http://en.wikipedia.org/wiki/Ext4

These may help you as well:
http://serverfault.com/questions/104986/what-is-the-maximum-number-of-files-a-file-system-can-contain
Most Valuable Expert 2013
Top Expert 2013
Commented:
Basically, there is no practical limit to the number of files under a directory, but there are limits per filesystem.

The maximum number of files per filesystem depends on the number of available inodes, which is either defined at creation time (e.g. ext3/4, jfs) or dynamic (e.g. jfs2) or fix (zfs).

The allowed maximum in ext4 is 4 billion, the fixed maximum in zfs is 2**48 (256 Tera).

There is also a limit to the number of subdirectories under a given directory, e.g. 32000 for ext3, 64000 for ext4.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial