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.

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.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

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

share|improve this answer
    
Thanks, it was helpful –  Rohit Bansal Jun 9 '12 at 18:24
add comment

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

Shake

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.

Defrag

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

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.