Maximum number of files per folder
Dear all,
I would like to ask you if there is any maximum allowed number of files per folder in linux (without risking it to lose everything). I am using openuse 11.4 with latest kde (4.6?). I am trying something fast and dirty and it might be that one folder will contain like 10^6 files. Is there is anything I should be warned about that? Best Regards Alex |
Hi,
I don't think there is a maximum number of files per directory, the maximum amount of files depends on the file-system used. Have a look here: Of filesystems and partitions Depending on the FS there is a maximum amount of sub-directories you can create in one directory (31998 for ext3 for example). If one million or more files in a directory is workable is another question, you might run into other (command) limits. For example: rm * might not work (argument list too long). Hope this helps. |
File and directotry limits
To be more precise, since we stopped using the old POSIX standard: OS limits on the number of files in a directory, the number of directories, or the size of files is irrelevant. The real restriction if from the File System limits. In some cases those are tunable to achieve different numbers, but the defaults are published.
Most of the limits would currently require someone do something VERY STUPID to approach on a small or home system. Personally, I cannot afford enough storage to even come close. If you have more detailed questions you can post them here, but you may find the information faster through google using the key "FILE SYSTEM LIMITS and the name of your file system. (EXT4, EXT3, EXT2, JFS, XFS, REISERFS, etc) |
I have always assumed a number of limits. Files per folder seemed to be one of them in all file systems but may be actually sub directories and files are considered the same.
As for ext3 ^ The maximum number of inodes (and hence the maximum number of files and directories) is set when the file system is created. If V is the volume size in bytes, then the default number of inodes is given by V/213 (or the number of blocks, whichever is less), and the minimum by V/223. The default was deemed sufficient for most applications. The max number of subdirectories in one directory is fixed to 32000. |
Hi,
Yes there is a limit but not as per files its as per filesystem or partiion , its 4 TB for ext4 filesystem. Punit |
Hi,
Quote:
- Max file size: 16 TiB - Max number of files: 4 billion But...... that was _not_ the question the OP asked. Maximum number of files per folder. Which has already been answered. |
Quote:
|
Hi,
The correct number is 31998 (ext3, max sub-directories per one directory). From Ext3 (wiki): Quote:
|
Dot and dot dot?
|
oh koool Thanks druuna
|
Hi,
Quote:
Any object in the file system must have a directory entry that connects it into the file system. For example, if you have a directory like "/tmp", there's a pointer in the root directory ("/") that points to the "tmp" directory entry. So that gives you one link. Every directory contains the "." link that points back to itself. So that gives us the minimum value of 2 links per directory. Every subdirectory has a ".." link that points back to its parent, incrementing the link count on the parent directory by one for each subdirectory created. The .. (dot dot) entry points to (and increases) its parent! Code:
cd / |
All times are GMT -5. The time now is 04:12 AM. |