[svlug] EMLINK (mkdir: cannot create directory `foo': Too many links)

Rafael Skodlar raffi at linwin.com
Mon Dec 3 11:49:01 PST 2001

On Mon, Dec 03, 2001 at 11:01:44AM -0800, Marc MERLIN wrote:
> On Sun, Dec 02, 2001 at 09:35:25PM -0800, Drew wrote:
> > If I do a `mkdir foo` I get:
> > 
> > mkdir: cannot create directory `foo': Too many links
> > 
> > This is EMLINK.
> > 
> > I'd like to correct this but don't know how.  Is there a way to
> > increase the total number of links allowed?  I need to at least double
> > it.

My question is this: what does the link provide you that the names do not? 
Perhaps the data needs to be organised in some other way rather than 
creating new links.

There is a filesize/(number of files) efficiency somewhere in this
equation which relates to disk perfomance, access time, disk space
efficiency, and possibly other things that should be looked at.

I've seen situations where the number of files was a problem at one point
and the solution was the reorganization of data structure. One posibility
it to have more partitions but the maintenance becomes a bit difficult.

The only other possiblity I can think of is 64 bit OS where the limit is
not at 32k. I don't know what the status of file systems in Penguin 64 is
at this point but it might be worth a try.


> I already talked to Drew, there is a limit of 32,000 links in an inode,
> which in turn limits the number of directories in a single place to 31,998
> There is no way to increase this  in ext2 without changing the inode format,
> which will not happen before a little while (dixit the major ext2 FS guys at
> ALS)
> Solutions:
> 1) use base/d/di/directoryname name splits
> 2) use another filesystem (note that the default filesystem on freebsd, and
>    probably many other FS do also have a limit of 32K directories or
>    somesuch, so for portability, you want solution #1)
> Marc
> -- 
> Microsoft is to operating systems & security ....
>                                       .... what McDonalds is to gourmet cooking
> Home page: http://marc.merlins.org/   |   Finger marc_f at merlins.org for PGP key

Let us know how you solve the problem.

# My login password is misspelled name of town 10 km from my birthplace
# and is subject to change without notice!

More information about the svlug mailing list