Max # of files/dirs under Linux?
bscott at ntisys.com
bscott at ntisys.com
Tue Dec 10 14:28:01 EST 2002
On Tue, 10 Dec 2002, at 2:17pm, f at ke1g.mv.com wrote:
>> Maximum number of files in a single directory = Unlimited
>> Maximum number of subdirectories in a single directory = 32768
>
> But a subdirectory is a file. (At least it was on good/bad old UFS.)
That's a common statement, and it generally works, but if you want to get
into technicalities (and we are), it is not strictly true. Files are
inodes. Directories are inodes. Files are not directories. Creating
multiple links to a file simply names the referenced inode in more than one
directory, but links to directories are special. Every directory has a link
in its parent directory (the directory name), a link in itself (named "."),
and a link in each of its subdirectories (named ".."). Other than those
specific cases, links to directories are not allowed. Thus the pile of
inodes on the disk is turned into a tree structure.
> Why should there be a limit on subdirectories in a directory if there's
> none on files?
I have no idea. I am just parroting the EXT2 documentation that comes
with the kernel. :) One obvious guess would be that the link-count for an
inode is stored in a 16-bit signed integer, but I really don't know.
--
Ben Scott <bscott at ntisys.com>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or |
| organization. All information is provided without warranty of any kind. |
More information about the gnhlug-discuss
mailing list