heavily fragmented file system.. How to defrag it on-line??

Guolin Cheng guolin at alexa.com
Wed Mar 3 23:01:35 UTC 2004

Hi, all,

 I got machines running continuously for long time, but then the underlying ext3 file systems becomes quite heavily fragmented (94% non-contiguous).
 We just don't have a chance to shutdown the machines since they are always busy..

 I tried the defrag 0.70 version comes with e2fsprog package and standalone 0.73 packages, but neither help me since the defrag tool can not handle ext3.  A thrid-party commercial tool oodcmd doesn't help as well since it can only deal with idle unmounted file systems, neither can it guarantee data integrity. For that case, I mean, when the machine is booted into repair mode and file system is not in use, We can use gtar to save|restore data without data loss, so the commercial tool can not do almost no help for us. 

 Anyone have any ideas on defraging ext3 file systems on-line? Thanks a lot.

The following is the defragment reported by e2fsck.. 

arc158.example.com guolin 135% sudo e2fsck -f -n -d /dev/hda9
e2fsck 1.27 (8-Mar-2002)
Warning!  /dev/hda9 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/0: 1225/8601600 files (94.3% non-contiguous), 12724107/17181982 blocks

 --Guolin Cheng

More information about the Ext3-users mailing list