Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2012 09:22:36 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Bernt Hansson <bah@bananmonarki.se>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: disk problem(s)
Message-ID:  <20120114092236.0c139ccd.freebsd@edvax.de>
In-Reply-To: <4F113290.1060706@bananmonarki.se>
References:  <4F113290.1060706@bananmonarki.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jan 2012 08:45:20 +0100, Bernt Hansson wrote:
> Hello list!
> 
>   7.3-RELEASE FreeBSD 7.3-RELEASE #0: Sun Mar 21 06:15:01 UTC 2010 
> root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
> 
> Whenever a program tries to make a directory on this slice it
> gets this error

It's a partition, not a slice. Partitions carry
file systems, slices carry partitions. :-)



> mkdir: spool/text/test: Too many links

So the problem seems to be related to directories, not
to "any files" (inodes) per se.



> This is the slice
> 
> /dev/ad4s4d    202G     37G    149G    20%    /news/spool/text

The partition; ad4s4 would be the slice. :-)



> One can create a file without problems just not directories.
> 
> Checked sysctl but don't know what to look for. A boot in the right end 
> would be helpful.

I would suggest to find out the reason, therefore
a short search though the src/ subtree reveals that
this message provided by mkdir is:

	#if defined (EMLINK)
	  ENTRY(EMLINK, "EMLINK", "Too many links"),
	#endif

As the mkdir program uses the mkdir() call, we find
"man 2 mkdir" with the error description for EMLINK:

	The new directory cannot be created because
	the parent directory contains too many
	subdirectories.

How many subdirectories are there?

Could you, for example, try removing one and then
creating a new one (assumption: success), followed
by another try to create one (assumption: fail)?



Detail:

The mkdir() function can be found (for UFS2) in the
file /usr/src/sys/gnu/fs/ext2fs/ext2_vnops.c at
line 1111 (sources of 8.2-STABLE i386 here). If
you examine what mkdir() does, you'll see that
the "too many links" is true when LINK_MAX is
exceeded. Per /usr/src/sys/gnu/fs/ext2fs/ext2_fs.h
we can determine that

	#define EXT2_LINK_MAX           32000

is defined. Can you check if 32000 is the amount
of directories created?


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120114092236.0c139ccd.freebsd>