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
|