Ubuntu – Do I need to defrag EXT file systems?

defragfilesystem

Possible Duplicate:
Why is defragmentation unnecessary?

I've been told that EXT file systems don't need to be defreagged because of the way they handle writes. Is this true? Would I benefit from a defrag every now and then? If so, what tools are best?

Best Answer

  • The linux kernel and linux filesystems do a lot of things to minimize fragmentation, but it's not true that fragmentation isn't possible. The amount of fragmentation is dependent on the type of usage of a filesystem (as Jeremy points to the Transmission bugtracker, large torrents can be an example of "bad" behaviour for fragmentation, depending on how applications work with them). In general, it doesn't get really bad normally, unless you manage to almost fill up your disk.

    Oh, and you get the best defragmentation by copying everything to another filesystem, deleting the old filesystem, and then copying everything back. That's also true on Windows... ;)

    Actually, you can do the copy + delete trick on the same filesystem too, but remember that you need to make a copy, then delete the old one, and not do a move/rename!