There are no programs like disk clean-up or defragmentation in ubuntu, so do we really need it...or if there are some utility packages for ubuntu.

2 Answers 2


Ubuntu/Linux uses a journaling file system but there are userspace defragmentation tools, like Shake and defrag for ext3.


Works by allocating space for the whole file as one operation, which will generally cause the allocator to find contiguous disk space. If there are files which are used at the same time, Shake will try to write them next to one another.


Works by copying each file over itself (so technically it is not defragging...). However, this strategy works only if the file system has enough free space. A true defragmentation tool does not exist for ext3.

However, modern Linux filesystems keep fragmentation at a minimum by keeping all blocks in a file close together, even if they can't be stored in consecutive sectors. Some filesystems, like ext3 and ext4, effectively allocate the free block that is nearest to other blocks in a file. Therefore it is not necessary to worry about fragmentation in a Linux system.

ext4: Extent

ext4 uses extent so it has a new program e4defrag as part of the e2fsprogs. So it is possible to defrag ext4. But if you are thinking it will speed up your system you are wrong.

An extent is a contiguous area of storage in a computer file system, reserved for a file. When a process creates a file, file-system management software allocates a whole extent. When writing to the file again, possibly after doing other write operations, the data continues where the previous write left off. This reduces or eliminates file fragmentation and possibly file scattering too.

An extent-based file system (i.e., one that addresses storage via extents rather than in single blocks) need not require limiting each file to a single, contiguous extent.

More info at kernel.org


Ubuntu does not need defragmentation because it uses ext4 file system which is less prone to fragmentation. You can install bleachbit package from the Ubuntu software center. It helps you clean junk. You should also install Ubuntu Tweak which is a very good tool to tweak Ubuntu.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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