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.

Why is defragmenting unnecessary in Ubuntu?

share|improve this question
add comment

5 Answers

up vote 40 down vote accepted

The underlying filesystems used by Ubuntu, like ext2 and ext3, simply don't need defragmenting because they don't fragment files in the same way as NTFS. There are more details at ext3 - Wikipedia, the free encyclopedia

share|improve this answer
    
+1 useful link! –  Wayne Werner Aug 5 '10 at 12:37
3  
Ubuntu is actually using ext4 now. –  Marco Ceppi Aug 5 '10 at 12:50
9  
ext4 is based on ext3 is based on ext2. :) –  Broam Aug 5 '10 at 16:28
26  
-1. Actually, they might very well need defragmentation, just to a much lesser degree. –  andol Aug 5 '10 at 19:06
1  
@andol, having some fragmentation does not mean you need to defrag. Windows "needs" it because it creates ridiculous levels of fragmentation. A small amount doesn't make any real difference, and Linux is very good at keeping it to an absolute minimum. –  psusi Nov 18 '13 at 2:23
show 2 more comments

Some argue that it's actually a myth that we don't need defragmentation. It's argued that we do in fact need it, but only once the filesystem gets pretty full (i.e. less than ~10% free space). Tools are available for defragging such as e2defrag.

share|improve this answer
9  
And those "some" are correct. It's not possible to not-fragment if there's just plain nowhere else left to write. –  maco Aug 14 '10 at 3:41
1  
Well one could argue that when you have less than 10% free space defragging for more free space isn't going to be your biggest problem and that a new hard disc could be wiser decision ;-) –  Rinzwind May 10 '11 at 9:44
6  
Watch out! Taken from this website:en.wikipedia.org/wiki/Ext3#Defragmentation " There is no online ext3 defragmentation tool that works on the filesystem level. An offline ext2 defragmenter, e2defrag, exists but requires that the ext3 filesystem be converted back to ext2 first. But depending on the feature bits turned on in the filesystem, e2defrag may destroy data; it does not know how to treat many of the newer ext3 features." –  Celso Jan 22 '12 at 17:34
1  
@Celso, see launchpad.net/e2defrag... it now does understand ext3/4. –  psusi Jul 13 '13 at 18:28
add comment

Fragmentation is the product of writing files in the first available open blocks on a drive. Over time, as files get created and deleted, small sections of disk open up, which causes newly written files to be split over several such openings. This can reduce performance, although it was much more of a problem in the past with slow hardware and slow disks.

The default filesystem in Ubuntu, ext4 (and until recently, ext3) are designed to limit fragmentation of files as far as possible. When writing files, it tries to keep the blocks used sequential or close together. This renders defragmentation effectively unnecessary.

share|improve this answer
add comment

See this link. It gives quite a detailed explanation of how files are stored in Windows and in Linux, and why Linux filesystems usually do not need to be defragmented.

share|improve this answer
add comment

Ext4 Howto - Ext4 According to this article ext4 defragments on the fly but they are working on a defrag tool. I personally don't think it is needed except maybe for file servers that get heavy use.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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