From owner-freebsd-fs@FreeBSD.ORG Mon May 31 23:23:39 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 59BD416A4CE for ; Mon, 31 May 2004 23:23:39 -0700 (PDT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5A2C43D5C for ; Mon, 31 May 2004 23:23:37 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i516NS5v022618; Tue, 1 Jun 2004 16:23:28 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i516NQ2O026967; Tue, 1 Jun 2004 16:23:27 +1000 Date: Tue, 1 Jun 2004 16:23:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Vulpes Velox In-Reply-To: <20040531213127.1eb7224c@vixen42.24-119-122-191.cpe.cableone.net> Message-ID: <20040601160031.T18025@gamplex.bde.org> References: <20040531213127.1eb7224c@vixen42.24-119-122-191.cpe.cableone.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@FreeBSD.org Subject: Re: file space 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: Tue, 01 Jun 2004 06:23:39 -0000 On Mon, 31 May 2004, Vulpes Velox wrote: > Does ufs have the same problem like FAT32, in that if a file exists, > it will all ways take up atleast 4KB or so, no matter how little data > it contains? Not exactly. ufs has fragments, which normally have size 1/8 of the block size, so a 1 byte file normally only takes 1/8 of the block size. However, the default block size is 16K, so fragments usually take up at least 2K. If nonstandard block and fragment sizes are used, then the minimum is the same for ufs and msdosfs: ufs: block size 4096, frag size 512 msdosfs: block size 512 With FAT32, 512-byte blocks can cover fairly large disks. IIRC, there can be 2^28 clusters for FAT32, so the maximum is 2^28*512 = 128GB. The default block size for msdosfs originally grew large (up to 32K or 64K) back when there was only FAT16 and the limit was 2^16 or 2^15 clusters. 2*16*32K is just 2GB, so even with the too-large block size of 32K wasn't large enough for new disks about 10 years ago. Since then, 4K has become the default for most cases since it is a good i/o size (still a little too small, but OK with some buffering), and because using a reasonably large block size helps stops the FAT size from beoming preposterously large (2^28 clusters takes 1GB for the FAT). Also, msdosfs has much smaller metadata overheads than ufs, so it can hold a lot of small files in the space that ufs would use for metadata. The wastage is very noticable on small file systems like ones that fit on floppy disks. Bruce