Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the Max File Count of an Ext3 Filesystem?

Status
Not open for further replies.

gwinn7

Programmer
Feb 10, 2001
1,004
US
Has anyone had experience with storing a massive amount of files in the Ext3 or Ext2 filesystem?

We have nearly 30,000 JPEGs (and growing) we will be putting to a single folder on our Linux box. What I am trying to discern is if this is going to be a problem. Then I may break up the files into folders by a preselected category.

So, if you have a recommendation based on prior experience or comments, it would be welcome.

Thanks,

Gary
gwinn7
A+, Network+
 
The upper limit is defined by the number of inodes your storage can hold. Inodes are arranged in three levels of indirection. The first inode can hold pointers to 12 data blocks (12k on a 1k block system) of data in direct blocks. It also holds a pointer to the indirect block, 2nd indirect block, and 3rd indirect block.

The indirect block contains a list of data blocks.

The 2nd indirect block contains a list of indirect blocks.

The 3rd indirect block contains a list of 2nd indirect blocks.

The storage capacity increases roughly by a power of two with each level of indirection, which is how ext2 can support files up to something like 4G with very little overhead.


The short answer is that as long as your storage medium has capacity for the data plus a little room for the inodes, you will be just fine. That is the only upper limit on the number of files.
 
Like segmentation fault was saying, the number of available inodes is what determines the max amount of files you can have in a filesystem. The df command can be used to see the percentage of inodes in use on a filesystem...

[root@cp root]# df -hi
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda3 864k 70k 794k 9% /
/dev/hda1 25k 40 25k 1% /boot
none 47k 1 47k 1% /dev/shm
/dev/hdb 3.9M 444 3.9M 1% /ftp

The -i switch reports on inodes, while the -h switch formats the output in human readable form.

ChrisP ---------------------------------------
If someone's post was helpful to you, please click the box "Click here to mark this post as a helpful or expert post".
 
Thank you both for the feedback. I will investigate this today.

Gary
gwinn7
A+, Network+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top