Tuesday, November 16, 2010

How to defragment XFS

There is an easy way to find out if your XFS partition needs defragmentation. Here is the command (it is part of package xfsprogs):
deby:~# xfs_db -c frag -r /dev/sda10
actual 2903, ideal 2418, fragmentation factor 16.71%
Once you see it is pretty high, e.g. above 40% you would need to issue the following command that defragment the drive:
deby:~# xfs_fsr -v /dev/sda10
/home start inode=0

No comments :

Post a Comment