From owner-freebsd-questions Fri Dec 12 23:37:08 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA02268 for questions-outgoing; Fri, 12 Dec 1997 23:37:08 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id XAA02263 for ; Fri, 12 Dec 1997 23:37:06 -0800 (PST) (envelope-from atf3r@cs.virginia.edu) Received: from ares.cs.virginia.edu by mail.virginia.edu id aa08772; 13 Dec 97 2:37 EST Received: from mamba.cs.Virginia.EDU (mamba-fo.cs.Virginia.EDU [128.143.136.18]) by ares.cs.Virginia.EDU (8.8.5/8.8.5) with ESMTP id CAA06430; Sat, 13 Dec 1997 02:37:02 -0500 (EST) Received: from localhost (atf3r@localhost) by mamba.cs.Virginia.EDU (8.7.5/8.7.3) with SMTP id CAA11457; Sat, 13 Dec 1997 02:37:02 -0500 (EST) X-Authentication-Warning: mamba.cs.Virginia.EDU: atf3r owned process doing -bs Date: Sat, 13 Dec 1997 02:37:01 -0500 (EST) From: "Adrian T. Filipi-Martin" Reply-To: Adrian Filipi-Martin To: Leonard cc: questions@freebsd.org Subject: Re: No defragmentation software needed? In-Reply-To: <3.0.2.32.19971212192133.0069fa6c@pop.slip.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 12 Dec 1997, Leonard wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Why is it that with FreeBSD, I don't have to run any defragmenting > utilities on the hard drive now and then? I keep thinking that > defragmentation should be a concern, but I remember being told that FreeBSD > takes care of that for me. > > Leonard You do not need to worry about defragmentation, because the Berkley Fast Filesystem, a.k.a. ufs, was designed to avoid fragmentation. There are a lot of reasons why it does a good jobs at this. You can learn all about it in "The Design and Implementation of 4.4BSD" by McKusic et. al. Basically, the kernel maintains cylinder groups in a filesystem in which it tries to store related disk blocks. This is used to avoid long seeks to different traks on the disk. Disk blocks may be related in several ways. They could be written at the same time, they could be part of the same file, or they could be inodes referenced from the same directory. By keeping these sorts of things somewhat well grouped, you avoid the problems assiciated with fragmentation, i.e. the cost of I/O operations are dominated by head seek times. FYI, the ammount of fragmentation reported for each filesystem when your system boots is the amount of wasted space in unseable fragments of the disk. These are the left over portions of allocated disk blocks that contain some data. e.g. a 1 byte file, will have 1023 bytes of slack in the fragment allocated to it. (assuming a 1k fragment/8k block filesystem.) You generally wil not see this figure get much over a few percent. Adrian -- adrian@virginia.edu ---->>>>| If I were stranded on a desert island, and System Administrator --->>>| I could only have one OS for my computer, Neurosurgical Visualzation Lab -->>| it would be FreeBSD. Think about it..... http://www.nvl.virginia.edu/ ->| http://www.freebsd.org/