Why you don’t have to defrag Linux like Windows?

One of the question that come out every once a while from new GNU/Linux users is how to defrag Linux? Usually most would be satisfied with the short answer “Linux does not need filesystem defragmentation like Windows”.

For curious users who prefer a rather complete explanation about why GNU/Linux filesystem doesn’t need defragmentation like WIndows are, then this article might provide such answer to you : Why doesn’t Linux need defragmenting?

Hope that answer your questions about Linux (or other Unix-like) filesystem for that matter.
[tags]linux,windows,fat32,ext3,filesystem,defrag,defragmentation[/tags]

14 Replies to “Why you don’t have to defrag Linux like Windows?”

  1. I found with Linux that the filesystem slows down after lots of abuse. It’s just most people don’t fill up their Linux partitions because nothing really works on Linux.

  2. Have been using Linux for 2 years now and my Box never needed defragging. My win xp box however has to go through defragging every week or so for optimal access. So in my experience vs MYTH I often found windows to Fragment VERY oftem. Even small little txt files are chopped up and thrown all over the drive as shown using defraggler.

    So myth or not, windows would be a fragmentation nightmare if you use your box often as I do.

  3. Agreed, ext3 gets fragmented.

    => why is there not one single well-known defragmentation tool available under Linux, at least, to visualize what the fragmentation looks like accross clusters ?

  4. To a first approximation, this is a placebo effect. All the claims being made about ext3 today were also made about NTFS back in 1993. Actually, ext2 and NTFS both date from around 1993. They share the same design goals, but use different heuristics to avoid fragmentation. In the end, both will fragment, but because the anti-fragmentation heuristics ar edifferent, which one fragments faster depends largely on the pattern of disk accesses.

    The original version of Windows NT shipped without a defragmenter. One was developed by a third-party, which was then licensed into Windows: http://technet.microsoft.com/en-us/sysinternals/bb897427.aspx

    Because Windows has a defragmenter which reports fragmentation percentages, people walk away with the impression that NTFS fragments. Because the various Linuxes do not have good defragmentation tools, people believe the party line.

    This party line: “Linux doesn’t need defragmentation” line is just fanboy bullshit. You can defeat any heuristic by doing the exact opposite that the heuristic expects you to do. The real question is: Which filesystem’s heuristic works better for your application?

    Without being backed by hard numbers, it’s all a bunch of handwaving and “Linux r0xx3r! Open-source great! Micro$ux!”

  5. Linux is subject to framentation, every real technical expert knows that for a fact.

    So claiming and spreading a myth is wrong, you need to do your research deeply and get the facts straight among the countless claims that “Linux does not need defragmentation”.

    The real explanation is that the ext3 filesystem as well as the OSX 10 filesystem are using journaling which is “more efficient” in putting everything related to a file together unlike FAT/NTFS filesystems (NTFS uses metadata).

    EXT3 and OSX10 also alot a few space after each file for future file size expansion, and if it is not available, it will use the “closest” free space to the file.

    You do not need to defragment an ext3 or osx10 filesystem because of its efficient placing of the files and use of the free space of the HDD.

    BUT, it is still fragmented. Two fragmentations to be exact.

    1: Free Space fragmentation – because these filesystems alot free space after each file, so you get a fragmented free space;
    2: Fragmented Files – these filesystems will use the “closest” free space to the related file to use, hence, the file is still fragmented.

    There are no filesystem in existence today that is truely “fragment-less”. EXT3 and OSX10 are just the two filesystems that “efficiently” places the files.

    In other words, “Linux does not need deframentation” is false, because sooner or later, you will want and/or need to defragment your EXT2/EXT3 and OSX10 (for Macs) file system.

  6. haha, tell them that the filesystem it uses is diff and does not require any defrag la …

    only windows filesystem requires defrag or the way windows manages it fills which requires it to be defrag every non and then

Comments are closed.