Is there any defragmenter out there for ext3?
-
4Linux doesn't need...oh. Well, never mind :)– triplethreat78Jan 12, 2011 at 1:21
-
@DJTripleThreat: Where's the dislike button...– user541686Jan 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. :)– nem75Jul 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 MAJORDec 8, 2021 at 11:39
Add a comment
|
3 Answers
6
-
-
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.– psusiApr 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 SApr 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 SApr 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 ).– psusiApr 19, 2017 at 2:18
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
)? Jan 11, 2011 at 23:23 -
-
2Whilst 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. Aug 30, 2012 at 18:34
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.
- 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.
- 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.