From owner-freebsd-questions@FreeBSD.ORG Mon Nov 27 02:11:25 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA86416A4FD for ; Mon, 27 Nov 2006 02:11:25 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3655843F85 for ; Mon, 27 Nov 2006 02:03:46 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.8) id kAR24MYg076825; Sun, 26 Nov 2006 20:04:22 -0600 (CST) (envelope-from dan) Date: Sun, 26 Nov 2006 20:04:22 -0600 From: Dan Nelson To: Peter Schuller Message-ID: <20061127020422.GH29363@dan.emsphone.com> References: <200611270131.44366.peter.schuller@infidyne.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200611270131.44366.peter.schuller@infidyne.com> X-OS: FreeBSD 6.2-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-questions@freebsd.org Subject: Re: Empty directory 60M in size; used to contain 1.7 million files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2006 02:11:25 -0000 In the last episode (Nov 27), Peter Schuller said: > Observe: > > hyperion# ls -la > total 61634 > drwxr-xr-x 2 xxx yyy 63047168 Nov 18 21:33 . > drwxr-xr-x 6 xxx yyy 512 Oct 8 16:39 .. > hyperion# find . > . > hyperion# > > The one special circumstance is that the directory previously > contained 1.7 million small files, that are now deleted. This is on > FreeBSD 6.1 with UFS2 + softupdates. No snapshots exist of the > filesystem. > > 1.7 million files may be extreme, but I don't see why an empty > directory would ever consume more than one inode? Directories are only shrunk when a file is created and the slack directory space can be trivially truncated. This is to avoid useless compaction during "rm -rf"-style activities of a directory that will just be deleted anyway. Just create a dummy file with "touch" and the directory will shrink down to 1 block. You can then remove the file. -- Dan Nelson dnelson@allantgroup.com