[NTLUG:Discuss] Is there a disk defragmenter for Linux

Steve Baker sjbaker1 at airmail.net
Sat Dec 21 23:11:21 CST 2002


Rev. wRy wrote:

>>No - only crappy OS's need to have their disks defragged.

> Can you expand on this for a moment?  It's a critical difference between M$ 
> and Linux, and I've yet to stumble across anything other than one line answers
> to the question that say any more than what you've written.  Yes, I've looked
> at the LDP howto on filesystems.  I've googled (although perhaps on the wrong
> subjects).  I've taken various classes on *nix, but I've yet to see this
> explained.

Well, I confess that I don't understand the technical details - but as an observed
fact, when you run fsck and it reports your fragmentation, it's never very far
off 90% perfect.

> So how exactly does *nix write data to a hard drive that eliminates the need 
> for a defrag?  And why is there fsck if there is no need for a defrag?

fsck doesn't have anything to do with fragmentation - it checks the file system
for consistancy - for errors - and tries to repair them.

In theory, there should be no filesystem errors - but if your machine crashes
or you have hardware problems - then occasionally, something gets screwed up and
on your next reboot, fsck repairs it.

Nothing to do with fragmentation.

> Obviously Linux requires a different way of thinking than does M$, but I don't see how 
> saying "Crap OS'es need a defrag, Linux doesn't" explains what's going on under the
> hood, and often times with Linux, knowing what goes on under the hood is half the battle
> won.

Well, yes - but it's hard to be an expert about everything.  Some things outside
your own field, you just have to take on trust...or if it really bugs you - become
an expert.  After all, you can always read the source code for the file system and
see what clever thing it does.

Personally, I'm happy to take it on trust that fragmentation isn't an issue.

Practical experience says it's not.  Many Linux systems run for a year or more
without being rebooted - much less defragged - and nobody notices any drop in
performance in the way you do on a horribly fragmented Windoze system.

As you use Linux longer, you see more and more places where your past experience
with Microsoft's poor design and implementation have led you to believe that
certain horrible parts of using a computer are somehow inevitable.  Liberation
from those problems sometimes seems too good to be true.

These are considered 'good practice' for desktop systems running Windoze:

   * Defragging.
   * Rebooting once a day to flush out memory that Windoze doesn't free up.
   * Reinstalling the operating system periodically to "clean things up".
   * Rebooting after a major program crashes just in case it corrupted
     something.
   * Running regular virus scans.
   * Not opening attachments on email.

...none of them are needed under Linux - but that's not because there is
special magic inside Linux - you don't have to do those things under BSD
or IRIX or Solaris or HPUX either.  They are all caused by inept
design and implementation from our buddies at M$.

Joe Public doesn't realise that computers can be any other way - so
these things are never identified as "unnatural".  People think that
defragging is "a good thing" - when in fact they are just exercising
a really lame workaround for something I'd consider to be a bug.

So, welcome to the brave new world!
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net





More information about the Discuss mailing list