From owner-freebsd-fs@FreeBSD.ORG Thu Sep 30 02:49:02 2004 Return-Path: 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 7293716A4CE; Thu, 30 Sep 2004 02:49:02 +0000 (GMT) Received: from pd3mo1so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2463C43D5C; Thu, 30 Sep 2004 02:49:02 +0000 (GMT) (envelope-from nehalmistry@gmx.net) Received: from pd5mr7so.prod.shaw.ca (pd5mr7so-qfe3.prod.shaw.ca [10.0.141.183]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I4U000GM2HO6FE0@l-daemon>; Wed, 29 Sep 2004 20:49:00 -0600 (MDT) Received: from pn2ml9so.prod.shaw.ca ([10.0.121.7]) by pd5mr7so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I4U004NH2HOHH40@pd5mr7so.prod.shaw.ca>; Wed, 29 Sep 2004 20:49:00 -0600 (MDT) Received: from nehal (S0106000ae6ceb225.vf.shawcable.net [70.68.12.33]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with SMTP id <0I4U001982HO02@l-daemon>; Wed, 29 Sep 2004 20:49:00 -0600 (MDT) Date: Wed, 29 Sep 2004 19:49:16 -0700 From: Nehal In-reply-to: <20040929230929.GA31474@VARK.MIT.EDU> To: David Schultz Message-id: <20040929194916.00000f43@nehal> MIME-version: 1.0 X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.3.0; Win32) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <20040929101403.000027aa@nehal> <20040929204233.GB30629@VARK.MIT.EDU> <20040929154328.00001444@nehal> <20040929230929.GA31474@VARK.MIT.EDU> cc: freebsd-fs@FreeBSD.ORG Subject: Re: data blocks question X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2004 02:49:02 -0000 On Wed, 29 Sep 2004 19:09:29 -0400 David Schultz wrote: > On Wed, Sep 29, 2004, Nehal wrote: > > On Wed, 29 Sep 2004 16:42:33 -0400 > > David Schultz wrote: > > > > > On Wed, Sep 29, 2004, Nehal wrote: > > > > on my ufs2 partition, there is a file that has a size of > > > > 65536, and has 2 direct blocks only. the block size of the > > > > fs is 16k and fragment block size is 2k. > > > > > > > > how can this be possible? wouldn't 2 direct blocks mean > > > > that the maximum size is 2x16k = 32k? or am i not > > > > understanding something correctly? > > > > > > > > i've made a copy of the file, and the new file has 4 > > > > direct blocks. > > > > > > > > it is a binary file, and i can read it fine (ie, cat it). > > > > i've done fsck on the filesystem and it found no problem. > > > > > > Yes, UFS supports sparse files. That is, you can have a > > > file with parts you haven't written to, and the blocks for > > > those parts won't be allocated. The cp utility doesn't know > > > about this, though, so copies will have the ``holes'' filled > > > with zeroes. > > > > > > > how would i determine the offset and length of these 'holes' > > for sparse files? > > It's an implementation detail, so you're not supposed to need to > know most of the time. You can use fsdb to find out. > i would like to know how it is implemented. is there somewhere in the freebsd source that i can find this info? Nehal