May you have ever used filesystem defragmentation tools (like Norton SpeedDisk or Piriform Defraggler) on Windows, you have probably seen such a diagram:


It displays a filesystem sectors map, painting (as for this particular example) sectors (sets of sectors actually, to fit the whole partition in the screen) occupied by non-fragmented (contiguous) files in blue, the opposite in red and free sectors in white (and some more colours for some more particular cases which can happen to be of interest). You can click on a "sector" and see what particular files "live" there.

Is there such a visualization tool for Linux?


2 Answers 2


I had the same question, but there was no appropriate software. I tried to build davl, but did not succeed in that. So I ended up writing my own tool. You can find it here: https://github.com/i-rinat/fragview


Use Ctrl + mouse scroll to change map scale.

  • Can't make it. I've tried crating an empty "build" subdirectory and running cmake there as you write in the README.md file but it just prints cmake help.
    – Ivan
    Oct 1, 2012 at 19:06
  • You should run "cmake ..", where ".." is directory with source. Oct 1, 2012 at 19:15
  • Kind of better but still no luck, @rinat-ibragimov: pastebin.com/X5hQAmiW (Ubuntu 10.04, 32-bit x86).
    – Ivan
    Oct 2, 2012 at 1:37
  • 1
    @Ivan, try to install these -dev packages: apt-get install libboost-dev libsqlite3-dev libgtkmm-3.0-dev Oct 2, 2012 at 9:09
  • A way better but still no luck: pastebin.com/nsuUYafv
    – Ivan
    Oct 5, 2012 at 23:32

There's dav, the "Disk Allocation Viewer" (supports ext2 and ext3; websites dates back to 2005, could be a little bit-rotted...)

visualizing the partition's fragmentation

  • Thanks. This seems right the answer to the question. But it is pretty rotten indeed - it seems be intended for Fedora Core 2 environment and fails to compile as is. It is going to require some C developer work to be done to animate it...
    – Ivan
    Feb 3, 2012 at 18:16
  • 1
    I think a tool like this will be added to distros such as Ubuntu soon. With the advent of online defrag in ext4 and btrfs, it seems more appropriate. With other filesystems, the only way to defrag was to unmount the filesystem first. Feb 3, 2012 at 20:20
  • Unmount the filesystem first is absolutely not a problem in case of desktop use. I don't even mind rebooting from a dedicated livecd to defrag. A non-esoteric defrag tool for Linux seems a miracle for me, I don't except it to appear any soon. Now all I dare to wish is to see what does my fragmentation does look like at least (I am pretty curious actually - I want to see it with my own eyes to conclude if the "ext is not fragmentation-prone" statement is truth or just an "urban legend").
    – Ivan
    Feb 3, 2012 at 20:35
  • Actually, offline defrag is even better (as it doesn't have to leave any files untouched because of them being locked by processes running in parallel or the file system driver itself) and so far can be preferable for desktop use (as non-stop uptime is not required).
    – Ivan
    Feb 3, 2012 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .