[KLUG Members] Defrag'ing ext3 filesystems?

Adam Williams members@kalamazoolinux.org
02 Oct 2002 13:47:02 -0400


>>>Okay, all the usenet messages I've been reading about ext2/3 not
>>>needing to be defragmented are full of crap!
>>"...This means that fragmentation is guaranteed to get worse over
>>time, and the only way to fix it is to wipe the filesystem clean, and
>>restore all the original files from a backup."
>>You'd have to convert your ext3 back to ext2, defragment, and then
>>convert back to ext3.
>ext3 *is* ext2 with a /.journal file.  I booted off an initrd (to avoid
>burning a CD-ROM or needing multiple floppies) and defragged my
>unmounted ext3 drive.

Unmounted an ext3 system is an ext2 as the journal isn't open.    I'm
not certain how the journal would feel about being moved while open.  An
external journal might be fine.

Having the journal be just-a-file is clever but poses all kinds of
problems for filesystem utilities.  

Just setting aside a list of blocks that are not apparent to the
filesystem (ala XFS) is a better solution, that is if you feel you MUST
keep the journal internal to the file system.

I like AIX's method where you pick a physical volume (or more than one)
and a partition is created to contain the journals of all (more or less)
the file systems.  Makes having an external journal minimal fuss, and
without having to create a boat load of itty-bitty volumes (or
partitions in the case of pre-RH8).

Having to boot to rescue media or unmount the filesystem to defrag isn't
an acceptable solution in some situations.

...

>>I haven't used it in awhile,  I don't know how much it will like newer
>>2.4.x kernerls.  It certainly knows nothing about ext3 filesystems.
>>Want to start making BS-Ware PRO again?
>For XFS? I thought Red Hat already supported XFS out of the box?

Not in 7.3.  And it isn't in the 8.0 installer, so I doubt it.