"Ron Johnson, Jr." wrote:
> 
> "Brian T. Schellenberger" wrote:
> >
> > WeiQuan Tian wrote:
> > >
> > >  Dear all:
> > >
> > >  Could any body know there is any utility like Defrag under Windows for
> > > optimization of Hard disk in Mandrake 6.0 or RPM in higher version?
> > >
> > >  Thanks in advance,
> > >
> > >  Wei Quan Tian
> >
> > No, the Linux file system is designed properly, so there's no need.
> 
> What does "(ext2) is designed properly, so there's no need" mean?
> 
> No filesystem can be designed to eliminate fragmentation.  If
> you are constantly "churning" on your disk, especially if your
> disk is > 80% full, it *will* become fragged.

Why?

First of, there's nothing magical about 80%; it gets more fragmented
(even with an optimal design) as the ratio of the size of the average
file that's being created & destroyed to the amount of free space gets
too large; this is more nearly a function of the absolute amount of free
space than the percentage of the disk partition.  This is especially
true since it really doesn't affect performance in any material way if a
200M file is broken up into a few dozen 4M chunks, say; what hurts is
when the 200M file is broken up into lots of 1K chunks.  In fact,
chances are that whatever program you are using to *process* the data
doesn't really benefit by reducing the chunk size below something on the
rough order of 64k, because (unless you are doing nothing but
raw-copying the file) the program will have to stop and actually process
the data somewhere along the way, and (especially with a read-ahead
cache) the seek can happen "for free" while the processing is going on.

With all of that, you probably aren't in trouble 'til the partition is
at least 95% full.

*And* the ext2 file system (with default parameters) never permits the
file system to get over 95% full!  So it forces you to leave enough room
for it to avoid any serious fragmentation.

(Unless you are running as root, in which case you have no business
continuously creating and destroying files anyway---root's way to
dangerous for that sort of task.)

If you are concerned, you can run fsck; it'll tell you percentage of
discontiguous blocks, but it's generally quite low, and if you were to
probe further (eg, with ext2ed [sp?], you'd find that the large majority
of those are very large files where they are harmless.

The big advantage of the ext2 file system: The entire disk is its
oyster; it has no prejudice in favor of using the earlier cylinders
first, or leaving the last ones for root.  Any old cylindar will do just
fine.  It is biased against fragmentation, though.

> 
> Of course, high speed disks, high speed CPUs and lots of RAM
> for cache will minimize fragmentation's effect...
> 
> Of course, since I have high speed disks, high speed CPUs and
> lots of RAM for cache, and the disks are < 80% full, and I
> don't "churning" on my disks, I don't defrag my disks.


-- 
"Brian, the man from babble-on"              [EMAIL PROTECTED]
Brian T. Schellenberger                      http://www.babbleon.org
Support http://www.eff.org.                  Support decss defendents.
Support http://www.programming-freedom.org.  Boycott amazon.com.

Reply via email to