Why, ext2 don't need defrag 

> the artist formerly known as dan said:
> >I understand that the ext2 filesystem is a little "smarter" then the fat
> >fs, and it does not need to be defrag.  But can someone explain why, I
> >mean the physical architecture of how the ext2 fs works, or if it's too
> >much to explain does anyone know of a site that can thoroughtly
> >breakdown how the ext2 fs works.
>
> See:
> <http://step.polymtl.ca/~ldd/ext2fs/ext2fs_toc.html>[]
>    Analysis of the Ext2fs structure
>
> As well as the references by Remy Card and Theodore Ts'o that are
> referenced therein.
>
> It is _NOT_ a "comparative analysis of ext2fs _as compared to DOS FAT_"
> and thus will not provide a detailed answer as to _why_ ext2 is better.
>
> That is left as an exercise to the gentle reader; if you're not up
> to looking at the sources and assessing it yourself, you would likely
> not be able to find actual value in anything more specific than the
> rather blank claim that "ext2 allocates files more intelligently than
> FAT."

Right. What would be more helpful would be an explaination as to why the FAT file system (MS-DOS/MS-Windows file system) both does fragment (which is not in *inself* bad) and why a fragmented FAT file system is bad, *partitularly* in the context of MS-DOS & MS-Windows.

The simple / short explaination has to do with the fact that the FAT file system uses a *simple* linked list. Linked lists are notorious for fragmentation — which is a major problem with LISP systems under memory-starved conditions — they tend to page fault all over the place after things are running for a while. This is *exactly* what happens with the FAT file system. Note: fragmentation itself is not really bad, if the operating system is designed to cope with the fragmentation *intellegently*, which usually means things like smart cacheing and various sorts of file system 'look ahead' / 'read ahead' features, which MS-DOS & MS-Windows generally lack (MS-DOS lacks these features, as does MS-Windows 95, 98, and ME — 'NT and 2K are a little better). Note ext2 does fragment some, but both the ext2 structure and Linux itself are *designed* to cope with the fragmentation in an intellegent fashion and not suffer performance degradation because of it.

The FAT file system was originally invented for *floppy disks*, which are relatively low capacity and where there is not really massive file creation and deletion. Also floppies are slow (in a relative sense) and don't have the spare sectors for a more complex file system. (Linux people tend to use the FAT filesystem for floppies, since Ext2 has too much overhead for floppies). Fragmentation on a floppy is easy to cure: copy everything off the floppy, reformat it and copy everything back. Actually floppies tend to wear out before fragmentation becomes serious. Or else the files on a floppy are 'static' (they are backup copies).

Robert Heller @cs.umass.edu

Why, ext2 don't need defrag 

> EXT2-fs warning: checktime reached, running e2fsck is recommended
>
> Doesn't e2fsck also "defrag" a bit as well as checking the file-system?
>

No. It just checks the file system. The "EXT2-fs warning: checktime reached, running e2fsck is recommended" is not specific to SuSE. It is a normal part of the EXT2-fs code.

Robert Heller @cs.umass.edu