Ubuntu – ny disk defragmenting GUI like piriform’s Defraggler for Linux

defrag

I'm looking for a tool that can give me a visual representation of my ext4 fragmentation. Something similar to how Defraggler, Puran Defrag, and many others (UltraDefrag being the best) display your disk… (most good UIs display the files in the block you're hovering your mouse over)

Is there anything related for Linux?

I want to watch my disk and see just how "unneeded" defragmentation really is.

I don't want to use e4defrag, because I'm not sure it can show me what exactly it's doing to my disk.

Best Answer

  • The question is not if there is fragmentation. All file systems have some fragmentation.

    The question is if the fragmentation is enough to affect performance.

    On Linux file systems, fragmentation is typically less then 5%, often 1 or 2% unless the disk is 99% full. In the event of a full disk, you can see significant fragmentation, but in that case the problem is a full disk.

    $ sudo fsck.ext2 -fn /dev/sda1
    e2fsck 1.42 (29-Nov-2011)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    Ubuntu_Rescue: 291595/1222992 files (**0.2% non-contiguous**), 1927790/4882432 blocks
    

    So yes, there is 0.2 % fragmentation, but this is well below the 85% threshold to affect performance.

    See the blog post Why doesn't Linux need defragmenting?.

    On Windows, it is not uncommon to see 50% or higher rates of fragmentation (I have seen 200% plus). Thus windows needs defragmentation tools.

    On Windows they advise defragmentation at thresholds of about 85%.

    See:

    So, bottom line, defragmentation is not a large enough problem on Linux to affect performance, so there are no significant defragmentation tools and you are sort of wasting your time worrying about it.