xfsdump - Administrative utilities for the XFS filesystem
xfslibs-dev - XFS filesystem-specific static libraries and headers
xfsprogs - Utilities for managing the XFS filesystem
一、查看碎片
1、查看/dev/sdc1的碎片情况:
# xfs_db -c frag -r /dev/sdc1
actual 93133, ideal 8251, fragmentation factor 91.14%
这个应该整理一下碎片了 :)
2、查看/dev/sdb1的碎片情况:
# xfs_db -c frag -r /dev/sdb1
actual 905607, ideal 900507, fragmentation factor 0.56%
这个不用做碎片整理。
3、另一种命令形式:
# xfs_db -r /dev/sdd1
xfs_db> frag
actual 117578, ideal 116929, fragmentation factor 0.55%
4、也可以通过xfs_bmap命令了解某个文件的情况:
# xfs_bmap -v case19.dat
case19.dat:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL
0: [0..9551]: 592061576..592071127 1 (103696496..103706047) 9552
1: [9552..86039]: 599312816..599389303 1 (110947736..111024223) 76488
2: [86040..170399]: 599655400..599739759 1 (111290320..111374679) 84360
3: [170400..256799]: 599751632..599838031 1 (111386552..111472951) 86400
4: [256800..340079]: 1185490752..1185574031 2 (208760592..208843871) 83280
5: [340080..592703]: 1185577976..1185830599 2 (208847816..209100439) 252624
二、整理碎片
# xfs_fsr /dev/sdc1
三、他从xfs_fsr得到了好处:) (摘自http://www.linux.com/feature/141404 )
Wow! Thanks. That'l teach me to use a non-default tech without researching it.
Over the years, my MythTV box had gotten inexplicably slow with lots of disk access for many operations like starting playback of a recorded video. With the advice here, I measured 98.6% fragmentation. A few sample files I checked that were 1-6GB captured MPEG-2 videos were stored on over 30,000 extents!
After 2 nights of de-fragmenting, I'm down to 17% fragmented and startup time of playing a video is noticeably faster with less hard drive activity.
四、参考
http://www.linux.com/feature/141404