SUMMARY: number of entries in a single directory

From: Charles Vachon <cvachon2_at_mrn.gouv.qc.ca>
Date: Tue, 02 Feb 1999 10:22:00 -0500

Hello again, and thanks to the following for quick responses:

Keith Piepho <kap_at_uakron.edu>
"J. Dean Brock" <brock_at_cs.unca.edu>
Jerome M Berkman <jerry_at_uclink4.berkeley.edu>
alan_at_nabeth.cxo.dec.com
esci <esci_at_fastlane.net>

The original message appears at the end of this one.

The explanation to the observed condition lies in the fact that there is
a maximum number of 65536 (2**16) hard links that any file or directory
can have on DU, regardless of the file system type. When a directory is
created with mkdir, there are 2 hard links to the directory's inode: the
actual entry for the directory name in this directory's parent, and the
"." entry in that directory. This is why there are always at least 2
links to a directory entry using ls -l, as in:

drwxr-xr-x 2 vacch1 system 8192 Jan 27 17:14
test_directory

The creation of a large number of subdirectories will eventually fail,
when all 65536 hard links to the parent's directory exist. Since, each
subdirectory takes 2 links, you should be able to create about 32768
subdirectories before the limit is reached. Note that this limit is
irrelevant to regular files, since files do not use hard links as
directories do. Some responders said they had directories containing up
to 40,000 files, with no problem.

Thanks again, alpha-osf-managers!


#-#-#-#-#-#-#-#-#-original message-#-#-#-#-#-#-#-#-#-
Hello DU-admins,

Can someone explain me where does the 32768 (2**15) entries in a single
directory on DU come from? Both ADVFS and UFS exhibit the same limit.
Don't get me wrong! I do NOT have the intention of putting this large a
number of files or directories hanging out from a single directory. I'm
just curious, since I experienced this condition yesterday, after a
cleanup job ran daily in cron was commented out, letting a directory
grow up to the point that it was impossible to create a directory
(mkdir) or a file (touch) into it.

I've peeked here and there trying to find some documentation on this
limit, to no avail.

TIA
--
===============================================
Charles Vachon tel: (418) 627-6355 x2760
  email: cvachon2_at_mrn.gouv.qc.ca
  Administrateur de système
  FRCQ/Ministère des Ressources
  Naturelles du Québec
===============================================
Received on Tue Feb 02 1999 - 15:26:02 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT