From owner-freebsd-questions@FreeBSD.ORG Wed Apr 23 12:37:53 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1B8037B404 for ; Wed, 23 Apr 2003 12:37:52 -0700 (PDT) Received: from falcon.midgard.homeip.net (h76n3fls20o913.telia.com [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 1F43F43FBF for ; Wed, 23 Apr 2003 12:37:50 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: (qmail 12338 invoked by uid 1001); 23 Apr 2003 19:37:45 -0000 Date: Wed, 23 Apr 2003 21:37:45 +0200 From: Erik Trulsson To: David Kelly Message-ID: <20030423193744.GA12282@falcon.midgard.homeip.net> Mail-Followup-To: David Kelly , FreeBSD-Questions@FreeBSD.org References: <20030423163410.GA25333@grumpy.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030423163410.GA25333@grumpy.dyndns.org> User-Agent: Mutt/1.5.4i cc: FreeBSD-Questions@FreeBSD.org Subject: Re: block and fragment sizes with newfs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 19:37:53 -0000 On Wed, Apr 23, 2003 at 11:34:10AM -0500, David Kelly wrote: > Playing with UFS on CF (Compact Flash) cards where I'm concerned about > wear and tear, and maximum efficiency. > > It would seem "newfs -b 4096 -f 512" would result in fine grained > control over each and every 512 byte block on my CF card and eliminate > writes to multiple blocks when a write to a single block would do. > > The above creates a lot of "superblock backups", leading me to suspect > what I save in fragment size == block size, I lose in overhead to track > all these fragments. I don't think the overhead in used space for keeping track of the fragments would be significant. You might want to play with the -i parameter to newfs(8) to control how many inodes you need though. > > The default is "-b 16384 -f 2048", which if I understand correctly means > the minimum read/write to the filesystem will be 2048 bytes? > > A middle of the ground compromise is "-b 8192 -f 1024". > > What's the deal? In general you have that: large block size/fragment size => fast operation, lots of wasted space small block size/fragment size => slower operation, little wasted space For a solid state device (like flash memory) I suspect that the speed loss for smaller blocksizes would be less than it would be for a normal disk. I would suggest you try different block sizes and if there is no noticable speed difference between them you should use the smallest one (that would be 4096/512 for block/fragment size.) If there is a speed difference you would have to decide which is more important: speed or space. -- Erik Trulsson ertr1013@student.uu.se