See how fragmented a filesystem is

e4defrag

e4defrag -c {{/dev/sdXN}}

click the source code to copy install e4defrag on any operating system with command-not-found.com