2nd Follow on SUMMARY: Limit of # of subdirectories or files (Sol aris 8)

From: Andrew Diederich <andrew_at_NETdelivery.com>
Date: Tue Apr 17 2001 - 14:59:36 EDT
Apparently both summaries I posted earlier were correct, but had nothing
to do with my problem.  Darren Dunham and Nate Itkin pointed out the error
I was seeing was the LINK_MAX problem.  In /usr/include/limits.h is a 
parameter called LINK_MAX, which is the limit of times you may link to a
file.

Darren explained it well, so I put his response below.  Darren thinks it
can't
be changed, which is a bit of a pain in the neck.  We can always do
directory
hashing, but I hate it when the NT guys say "What? UNIX can't do that?  
Muhahahaha!"  Any ideas?

--
Andrew

Darren:
Directories aren't normal files.    Because directories have multiple
links all the time.  Files normally have a link count of 1, directories
with no subdirs have a link count of 2 (One link is from the parent, one
link is from the "." file).

If you have a subdirectory, then the link count goes up.  The
subdirectory points back to the parent with "..".  Do an 'ls -ld .' in a
directory that has subdirectories and one with none and observe the
difference.

This is your limiting factor.  The maximum number of links that you can
make to a single file is a hard limit of the filesystem.

% grep LINK_MAX /usr/include/limits.h 
#define LINK_MAX        32767   /* max # of links to a single file */

You cannot change that value.

I'm using 2.6, but you should be able to find that limit in 8, also.
Really, it's more of a filesystem limit.  I doubt it could be changed
without making the filesystem different, which could introduce some
incompatibilities.

-----Original Message-----
From: Andrew Diederich [mailto:andrew@NETdelivery.com]
Sent: Tuesday, April 17, 2001 12:02
To: sunmanagers@sunmanagers.org
Subject: Follow on Summary: Limit of # of subdirectories or files
(Solaris 8)


Kevin just sent me the info on fstyp, so I'm including it for posterity.

--
Andrew Diederich

     You have to calculate the number of inodes from the output.  "ncg" is
the number of cylinder groups and "ipg" is the number of inodes per
(cylinder) group.  Therefore, multiplying the two gives you the number of
inodes in the filesystem.  Yes, you can also do a "df -o i /filesystem" and
get the number of inodes free / used as well (which is probably easier).
Hope this helps...

Kevin Buterbaugh
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Apr 17 19:59:36 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:24:52 EDT