Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Dec 1997 02:37:01 -0500 (EST)
From:      "Adrian T. Filipi-Martin" <atf3r@cs.virginia.edu>
To:        Leonard <leonardc9@usa.net>
Cc:        questions@freebsd.org
Subject:   Re: No defragmentation software needed?
Message-ID:  <Pine.SOL.3.96.971213021825.11016A-100000@mamba.cs.Virginia.EDU>
In-Reply-To: <3.0.2.32.19971212192133.0069fa6c@pop.slip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.96.971213021825.11016A-100000>