Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to defragment Ubuntu; however, I cannot find software that I can download. What is available?

share|improve this question
Per the answers, is there a particular reason that you need to defrag, or is it just an assumption (one that I had trouble kicking) carried over from windows? – mfg Jan 25 '13 at 22:44

There is no good way to defragment Ubuntu, because it doesn't have a fragmenting filesystem like NTFS on Windows; i.e., there is no need to defragment. Take a look at Why is defragmentation unnecessary?

share|improve this answer
seconded - ubuntu uses a very different filesystem from windows and does not need to be defragged. – ImaginaryRobots Jan 25 '13 at 23:25

The current default filesystem for Ubuntu is EXT4. This does not normally need de-fragmentation (by design). > Ext4 Howto

Ext4 was released as a functionally complete and stable filesystem in Linux 2.6.28, and it's getting included in all the modern distros (in some cases as the default fs), so if you are using a modern distro, it's possible that you already have Ext4 support and you don't need to modify your system to run Ext4.

And their reference to defragmentation:

Online defragmentation

(This feature is being developed and will be included in future releases). While delayed allocation, extents and multiblock allocation help to reduce the fragmentation, with usage filesystems can still fragment. For example: You write three files in a directory and continually on the disk. Some day you need to update the file of the middle, but the updated file has grown a bit, so there's not enough room for it. You have no option but fragment the excess of data to another place of the disk, which will cause a seek, or allocate the updated file continually in another place, far from the other two files, resulting in seeks if an application needs to read all the files on a directory (say, a file manager doing thumbnails on a directory full of images). Besides, the filesystem can only care about certain types of fragmentation, it can't know, for example, that it must keep all the boot-related files contiguous, because it doesn't know which files are boot-related. To solve this issue, Ext4 will support online defragmentation, and there's a e4defrag tool which can defragment individual files or the whole filesystem.

Still want to defrag ..

Check out: > Ext4 defragmentation with e4defrag

To begin playing with e4defrag we must start compile of new kernel with patches needed to carry out the defragmentation. Below you will find a short description of that process, and if you would not like to use all those experimental patches for Ext4, then you should be interested in these seven only: ..

share|improve this answer

Your Answer


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.