[Sussex] Why Linux doesn't need defrag

John Crowhurst fyremoon at fyremoon.net
Thu Aug 17 16:53:49 UTC 2006


On Thu, August 17, 2006 15:01, Steven Dobson wrote:
> John
>
> On Thu, 2006-08-17 at 14:52 +0100, John Crowhurst wrote:
>> On Thu, August 17, 2006 12:29, linux at oneandoneis2.org wrote:
>> >
>> > http://geekblog.oneandoneis2.org/index.php/2006/08/17/why_doesn_t_linux_need_defragmenting
>> >
>> > I *think* I got the basic details right, but I'm not absolutely sure,
>> > so any feedback would be appreciated.
>>
>> http://en.wikipedia.org/wiki/Defragmentation
>>
>> Note that ext2, ext3, minix, xiafs, JFS and XFS have defrag programs
>> associated with them.
>
> What are the program name?  I can't find them with "man -k defrag".

For ext2, ext3, minix and xiafs the command is e2defrag. The program can
be found here (in a modified form):
http://e2compr.sourceforge.net/attic/defrag.html
or as defrag here:
http://revu.tauware.de/revu1-incoming/defrag-0601080159/

>> It seems that as Linux and Unix in general passes its file and disk
>> handling to underlying drivers, some of these formats require
>> defragmentation.
>
> But, generally. that defragmentation code is written into the filesystem
> code in *nux, but is a separate program in win32land.  I kinda think
> that is the reason.  All disks need defraging.  If you defrag as you
> write noramlly it is a small overhead on your disk output, but if it is
> a seperate program to be run by the user then the disk performance can
> suffer and the defrag time become significant.

I suspect with some file systems, defragging happens on-the-fly or doesn't
happen at all. Reiserfs stores the file structure as a b+ tree, perhaps
that removes the need for fragments and defragmenting, as the filesystem
has no defrag program.

--
John




More information about the Sussex mailing list