7

Is there any defragmenter out there for ext3?

4
  • 4
    Linux doesn't need...oh. Well, never mind :) Jan 12, 2011 at 1:21
  • @DJTripleThreat: Where's the dislike button...
    – user541686
    Jan 12, 2011 at 1:23
  • Desktop PCs do not need defragmentation, not even on Windows. It's the snake oil of the digital age. And this is not a lecture. :)
    – nem75
    Jul 30, 2012 at 16:00
  • my 4 year old DISH NetWork external DVR is an EXT3 hard drive and needs defragging really big time... e4defrag cannot do it... so?
    – The MAJOR
    Dec 8, 2021 at 11:39

3 Answers 3

6

http://launchpad.net/e2defrag.

6
  • How is e2defrag compared to Shake?
    – Alex S
    Apr 15, 2017 at 11:43
  • 1
    @AlexS, shake just copies files until they luckily happen to end up with no or few fragments thanks to the normal allocation algorithms. e2defrag runs on an unmounted volume and relocates every block on the disk so that they are all packed to the left ( within their native block group by default ), and are in the natural inode order of the files. As a result, it also maximizes the contiguous free space for new files to avoid fragmentation.
    – psusi
    Apr 17, 2017 at 14:58
  • So, e2defrag would be the best option for Ext3 partitions for now. While e4defrag does Ext4 better, if it support Ext3 we'd have something better?
    – Alex S
    Apr 17, 2017 at 16:23
  • How do I install it in Linux Mint (13/ 14 or 18/18.1)? I've typically downloaded .debs and used GDebi and am unable to have xenial etc get added on it
    – Alex S
    Apr 17, 2017 at 16:45
  • @AlexS, e2defrag works on ext4 as well ( unless you have a big enough disk to need the 64 bit feature ). I believe that e4defrag works by moving individual files around to defrag them similar to shake, without regard for packing them to make more contiguous free space. On the other hand, it does work with the filesystem mounted, and a crash or power failure while it runs won't leave your whole filesystem trashed ( backup before using e2defrag ).
    – psusi
    Apr 19, 2017 at 2:18
4

Shake

3
  • +1, interesting... so, reading that page, is it true that Linux has no native support for defragmentation like Windows does (with FSCTL_GET_RETRIEVAL_POINTERS)?
    – user541686
    Jan 11, 2011 at 23:23
  • It is currently in development. Google for e4defrag.
    – psusi
    Jan 12, 2011 at 1:03
  • 2
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – nanofarad
    Aug 30, 2012 at 18:34
1

There is a useful article but it's a few years old:
DEFRAGMENTING LINUX EXT3 FILESYSTEMS USING SHAKE AND DEFRAG

There are a few tools for this, and I'm going to cover Shake and Defrag.

  1. Shake is a defragmenter that runs in userspace, without the need of patching the kernel and while the system is used (for now, on GNU/Linux only).

It works by rewriting fragmented files. But it has some heuristics that could make it more efficient than other tools, including defrag and, maybe, xfs_fsr.

  1. Defrag is a shell script. Download the latest version from HERE.

Using Defrag is very easy: copy the script in a folder you want to defragment. This can be just a normal folder or the top level directory of a partition.


0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .