From owner-freebsd-questions@FreeBSD.ORG Mon Nov 27 19:39:35 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 3985B16A407 for ; Mon, 27 Nov 2006 19:39:35 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86A9644369 for ; Mon, 27 Nov 2006 18:35:04 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: by nz-out-0102.google.com with SMTP id i11so694234nzh for ; Mon, 27 Nov 2006 10:35:34 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=I2SUE9SNdZki8yCfJTT/dq4AvPm5puBkVnanyoZg70PeG9N0MUqOwRPEl3BcLZbrTM5/enF9iv15C+zz6N4PMUHI7+bAStRxLYRpohLkw4d091y9jiR9eD0kIBTzrx2/tCyiDrDF97BJJ2b+aRDLLkO0vUG2kbqwIgdJ2DbWQ0Q= Received: by 10.78.138.6 with SMTP id l6mr13480679hud.1164652532992; Mon, 27 Nov 2006 10:35:32 -0800 (PST) Received: by 10.78.167.16 with HTTP; Mon, 27 Nov 2006 10:35:32 -0800 (PST) Message-ID: Date: Mon, 27 Nov 2006 21:35:32 +0300 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: "Dan Nelson" In-Reply-To: <20061127020422.GH29363@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200611270131.44366.peter.schuller@infidyne.com> <20061127020422.GH29363@dan.emsphone.com> X-Google-Sender-Auth: 3568ef426c063145 Cc: Peter Schuller , 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 19:39:35 -0000 On 11/27/06, Dan Nelson wrote: > 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. Shouldn't it be done after a timeout? I can imagine scenarios when millions of small files are created and deleted in different dirs. Should it result in no disk space (and a clueless user)?