Investigating fragmentation on XFS

In situations where the filesystem is acting sluggishly, it is possible that fragmentation is impacting your server. In this instance, and if you suspect that fragmentation has occurred or is occurring, then simply run the following command on the relevant device:

# xfs_db -c frag -r /mount/point

By using this command, we are causing xfs_db to open the filesystem in a read-only mode (-r option) and passing a command (-c option) to get the file fragmentation data (frag) for the device in question. When we use the frag command, it will only return information relevant to the file data in the filesystem as opposed to concerning itself with the fragmentation of free space. So, depending on the specific nature of ...

Get Troubleshooting CentOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.