[wplug] linux system administration

Michael Skowvron skowvron at verizon.net
Thu Jul 8 15:51:32 EDT 2004


Bill Moran wrote:

> No.

Despite Bill's optimism of the unix filesystems, all filesystems 
fragment. Some filesystems are better than others at minimizing 
fragmentation, but no filesystem is immune. Fragmentation is also 
going to be somewhat related to how full your filesystem is and how 
much "flux" (file creation/deletion/appending) the filesystem 
experiences.

When there is lots of free space in the filesystem, large expanses of 
blocks can be allocated to files. This tends to minimize 
fragmentation. However, if your filesystems are close to full, 
filespace must get used "wherever it can be found" and this can lead 
to lots of fragmentation.

I am most familiar with the XFS filesystem. The engineers that 
developed it swore that it didn't need to be defragmented. They worked 
hard on it's design and were confident that they built a virtually 
fragment-proof filesystem.

Eventually they conceeded to customer demand for a defragmenter. 
Customers (especially those running realtime streaming of data) were 
able to prove that the filesystem fragmented despite it's design. 
Quite a few years after XFS had been widely deployed, SGI bundled a 
defragmenter for XFS and set it run regularly from cron.

In general, the root drive does not fragment by much. A majority of 
the files rarely change, so defragmenting usually doesn't gain much. 
User filesystems and maybe logging filesystems would be more prone to 
fragmenting.

WARNING: Do not defragment files that lilo depends on (/boot and 
others). If the files are moved, lilo must be re-run.

Michael



More information about the wplug mailing list