Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am launching a social networking website on LAMP Stack on Linux Ubuntu, I know that people are going to upload lots of pictures. Let's say I have 5000 users and each user upload a minimum of 100 pictures which is 500,000 pictures. I do have other files on the disk such as my web template images and etc.

Under my public www, I might have approximately 1 million files or more. Do Linux filesystems support that many files? What are the limitations and how to overcome them? Can anyone please explain what limits on the number of files there are in Linux in plain English?

share|improve this question
    
A million files is pretty small. But you should specify which filesystem you are using, or whether you are trying to decide that as well (some filesystems dont even use inodes). –  Patrick May 20 '12 at 7:17
    
To prevent issues with inodes, I often use reiserfs. Especially for my backup filesystem, which contains massive amounts of hardlinks. Reiser3 is stable and well supported. Reiser4: not sure about the current status. BTRFS doesn't use inodes either, but it is still marked experimental. As Patrick: writes couple of million files is peanuts and easily managed on the main stream filesystems. –  jippie May 20 '12 at 8:15
2  
@jippie, hard links don't use up inodes, they all point to the same one. Reiser3 is not well supported -- it was more or less abandoned after being merged into the mainline kernel and Hans Reiser started working on reiser4, which died when he went to prison for murdering his wife. –  psusi May 21 '12 at 23:26
add comment

1 Answer

It depends on what filesystem you are talking about. For ext[234], this can be configured with the -i byte-per-inode switch to mke2fs. The default value is 16KiB, so a 500GB filesystem will have about 30 million inodes.

share|improve this answer
1  
To expand on this (just to clarify a little), it means the number of inodes depends on the size of the filesystem. Its not a fixed number (that would be silly). –  Patrick May 20 '12 at 7:14
    
To expand a bit further on this ;o) ... when extending a filesystem, does the total inode count increase? –  jippie May 20 '12 at 8:09
    
@jippie for ext*, no –  Patrick May 20 '12 at 15:51
    
Actually, yes, it does. –  psusi May 21 '12 at 1:48
    
@psusi from the man page "Be warned that it is not possible to expand the number of inodes on a filesystem after it is created" –  Patrick May 28 '12 at 0:54
show 2 more comments

Your Answer

 
discard

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.