From owner-freebsd-questions@FreeBSD.ORG Sat Jan 14 08:22:39 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99165106564A for ; Sat, 14 Jan 2012 08:22:39 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6908FC0C for ; Sat, 14 Jan 2012 08:22:39 +0000 (UTC) Received: from r56.edvax.de (port-92-195-26-82.dynamic.qsc.de [92.195.26.82]) by mx02.qsc.de (Postfix) with ESMTP id 6AC8A1DE93; Sat, 14 Jan 2012 09:22:37 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q0E8MaEI004137; Sat, 14 Jan 2012 09:22:36 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 14 Jan 2012 09:22:36 +0100 From: Polytropon To: Bernt Hansson Message-Id: <20120114092236.0c139ccd.freebsd@edvax.de> In-Reply-To: <4F113290.1060706@bananmonarki.se> References: <4F113290.1060706@bananmonarki.se> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: disk problem(s) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 08:22:39 -0000 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, ...