xfs
[Top] [All Lists]

Re: file system defragmentation

To: Fong Vang <sudoyang@xxxxxxxxx>
Subject: Re: file system defragmentation
From: Jan-Frode Myklebust <Jan-Frode.Myklebust@xxxxxxxxxxx>
Date: Fri, 26 Aug 2005 12:11:31 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <4f52331f050826001612f8e323@xxxxxxxxxxxxxx>
References: <4f52331f050826001612f8e323@xxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Fri, Aug 26, 2005 at 12:16:16AM -0700, Fong Vang wrote:
> I've read in many places that file systems on Linux do not suffer the
> same fragmentation problems of Windows systems.  No one has provided a
> clear explanation as to why fragmentation is not an issue for file
> systems such as XFS.


I think it is a problem for XFS also.. at least for our slow growing
mailserver with lots of mbox-files.


> Also, is there a way to determine the percentage of fragmentation on
> an XFS file system?

  # xfs_db -c frag -r /dev/sdc1
  actual 59707, ideal 46970, fragmentation factor 21.33%

and individual file fragmentation can be checked with xfs_bmap:

  # xfs_bmap usersmbox
  usersmbox:
        0: [0..744815]: 31464808..32209623
        1: [744816..744831]: 31464792..31464807
        2: [744832..744959]: 31464664..31464791
        3: [744960..745063]: 31464048..31464151
        4: [745064..745215]: 31463896..31464047
        5: [745216..745335]: 31463768..31463887
        6: [745336..745471]: 31463632..31463767
        7: [745472..745583]: 31463504..31463615

and you can defrag either individual files:

  # xfs_fsr usersmbox
  # xfs_bmap usersmbox
  usersmbox:
        0: [0..747423]: 142372792..143120215

or a whole live partiion:

  # xfs_fsr /dev/sdc1   

(btw: i think xfs_db -c frag will be a bit slow in reporting the updated
fragmentation after a xfs_fsr, at least that's the impression I got
the last time I ran it) 


  -jf


<Prev in Thread] Current Thread [Next in Thread>