Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

marked as duplicate by Marco Ceppi Jun 5 '11 at 19:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

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!

share|improve this answer
add comment

The ext3 and ext4 filesystem do not need to be defragged, since they defragment themselves. You can read this for more information: http://en.wikipedia.org/wiki/Ext3#Disadvantages (if it's necessary)

share|improve this answer
    
Here en.wikipedia.org/wiki/Ext3#Disadvantages –  redlaber Oct 25 '10 at 6:19
3  
But how about: trac.transmissionbt.com/ticket/849 ? Quote: The default Ubuntu filesystem ("ext3") will fragment large (>1GB), slowly-growing files (<1MB/s) . Such files include torrents or huge downloads. –  Jeremy Oct 25 '10 at 6:23
2  
It is a file system feature. It specially fragments them. I don't know what for. –  redlaber Oct 25 '10 at 6:27
2  
It's a tradeoff, you have to sacrifice fragmentation on some files so you can improve fragmentation for others :) –  badp Oct 25 '10 at 7:24
4  
This answer seems completely wrong. Even the link given disagrees with it, saying that ext3 lacks a defragmenter. Ext3/4 do not defragment themselves. They are good at avoiding fragmentation though. @redlaber, fragmenting ( of torrents or otherwise ) is NOT a feature. –  psusi Apr 8 '11 at 19:03
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.