From owner-freebsd-questions Wed Feb 7 17:55:26 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 443CD37B491 for ; Wed, 7 Feb 2001 17:55:09 -0800 (PST) Received: (qmail 36984 invoked by uid 100); 8 Feb 2001 01:55:08 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14977.64636.712018.404928@guru.mired.org> Date: Wed, 7 Feb 2001 19:55:08 -0600 (CST) To: Tim McMillen , hiuho@yahoo.com Cc: questions@freebsd.org Subject: Re: Limit on number of sub-directories? In-Reply-To: <60468191@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Tim McMillen types: > > Is there a limit on the number of sub-directories I can have in a > > directory? (I'm using FreeBSD 4.0, 4.1, and 4.2.) Thank you. > > Yes, but it is pretty large. I'm not an ffs expert, but after reading > in the SMM, the only limit I see is in the number of inodes allocated > when the filesystem is created. See man newfs for the info on how many > inodes are created. As I understand it, by default there is an inode > created for every 4k of disk space per filesystem. So it is possible > to create too many directories and use up all the inodes. That means > you could only create 250 files in a MB of space. But for a 1gb > filesystem that works out to 250,000 fiels so it should be enough. As > it says in the manpage that means the average file is expected to be > 4k. If yours is smaller you need more inodes. The number of inodes in the file system is probably the lowest one, and the only one you're likely to run in practice. Since a directory entry uses up disk space other than in the i-list, you could run out of real disk space as well. You can also hit the file systems file size limit for the directory proper. Finally, each subdirectory adds a link to the directory, which increases the link count, which is an int (oddly enough, it's not unsigned). http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message