From owner-freebsd-fs@FreeBSD.ORG Fri Jul 28 15:10:31 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.ORG Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 613A416A4DE for ; Fri, 28 Jul 2006 15:10:31 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (megan.kiwi-computer.com [63.224.10.3]) by mx1.FreeBSD.org (Postfix) with SMTP id BD55743D69 for ; Fri, 28 Jul 2006 15:10:30 +0000 (GMT) (envelope-from rick@kiwi-computer.com) Received: (qmail 58582 invoked by uid 2001); 28 Jul 2006 15:10:29 -0000 Date: Fri, 28 Jul 2006 10:10:29 -0500 From: "Rick C. Petty" To: freebsd-fs@FreeBSD.ORG Message-ID: <20060728151029.GB58252@megan.kiwi-computer.com> References: <20060727175436.GA48057@megan.kiwi-computer.com> <200607280927.k6S9RG2B072245@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200607280927.k6S9RG2B072245@lurza.secnetix.de> User-Agent: Mutt/1.4.2.1i Cc: Subject: Re: Advice for hacking on ufs/ffs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2006 15:10:31 -0000 On Fri, Jul 28, 2006 at 11:27:16AM +0200, Oliver Fromme wrote: > Rick C. Petty wrote: > > > Not necessarily. If you install a variant of windoze, the installer will > > format the disk first, writing zeros (and metadata) sequentially, and > > thus the allocation will not be fragmented. > > Not true. Last time I installed Windows, it did not > overwrite the whole disk. If it did that, it would > have taken _way_ too long (hours instead of minutes). XP? I've certainly tried this with 2000 and it did precisely that. It certainly took hours to format 8+G NTFS partitions at install time. I'll check this out again today in qemu. Certainly qemu formats are significantly faster than native formats, due to FreeBSD's caching mechanisms. > > In the case of UFS newfs > > only the metadata will be written for each cylinder group > > No. Only the superblock copies and block bitmaps are > written during newfs, nothing else. For each cylinder group, the following is written: the superblock, the cylinder group map (summaries + block free bitmap), and "two blocks worth of inodes" (for UFS2.. in UFS1, all inode blocks are written). What else do you consider is the "metadata" for a filesystem? > > and thus the > > logical blocks for all metadata will be contiguous. > > Nope. As soon as you start writing to such a file system, > it will start allocating space for inodes, indirect block > lists, directories and file data, which will probably lead > to massive fragmentation. Things like indirect blocks will be allocated near the rest of the blocks for that file. So in allocation order: the first 12 direct blocks, the first indirect block, the blocks for that indirect block, rinse, repeat. Directories are just files, but they get pretty fragmented anyway (if the size of the directory, in bytes, is larger than one file system block, which by default is 16k). I wasn't disputing the fragmentation of these files but the performance of having the blocks of the underlying file-store allocated in the same order that UFS allocates them. It would be interesting to test the performance difference. -- Rick C. Petty