-
How to Defragment an Ext3 Filesystem
How do I defragment an ext3 filesystem?
Do not tell me that I do not need to defragment; I already know that, and that is not my question.
Thank you
-
Okay, so, if you know you don't need to do it, why worry about it?
http://www.biznix.org/whylinux/windows/fragment.html
However, if you are really curious, check out this page:
http://e2fsprogs.sourceforge.net/ext2.html
(Please note: ext3 = ext2 + journaling -- I think )
Distribution: Gentoo
Kernel: 2.6.9-r9-gentoo
Processor: Intel Pentium 4 1.3Ghz
RAM: 256MB RAMBUS
HD Space: 300GB (60/80/160)
<beastmaster> eh yeah same here, used to use mandy lol
<beastmaster> yeah damn.. that was a waste of 2 years right there lol
-
there is a tool called defrag that will defragment ext2 partitions (and since ext3 is backwards compatible it would work on ext3 as well), however, I have no idea how 'helpful' this would be...
irc.freenode.net #justlinux The Not So Official JL IRC Channel.
¤ Debian ¤ Apt-Get ¤
-
I have nothing on my filesystem with defrag.
locate defrag
=nothing
Searching freshmeat.net for 'defrag ext3' also produced nothing.
Why would you want to defrag a filesystem that does not require defragging?
-
EXT3 is a journaling version of EXT2
EXT2 can be looked as a very fancy FAT that is more stable and less prone to fragmentation
The journaling is what keeps anyone from needing to defrag an EXT3 drive. Think of the filesystem as a type of database, the directories are tables and the files are records. Every file that is put on the system is put into an index that is easily and quickly searchable. All files are indexed as they are created.
ALSO, everytime the partition is mounted it re-indexes everything for optimal performance, thus there is your defrag...re-mount the drive
-
There seems to be a utility on RedHat 7.3 called defragfs available to superuser. Maybe it is available on your distribution as well. Unfortunately, man defragfs nor info defragfs yielded no additional information on how it used. The others are correct however in that you do not need to defragment your fs. In the event, or rather, if it is the case that you want to migrate data from a larger partition onto a smaller partition, then I suggest that you create the smaller partition and put the ext2 filesystem on it via the mke2fs command. After that, I would issue the command (in a general way, you will definitely need to specify additional options) dump | restore which will go through recreate the same directory structure onto a smaller fs granted that the smaller fs is large enough to accommodate the space taken up by the original file space.
My experience with filesystems (ext2, at least) are that they occupy the entire partition and that files and data are distributed across the entire filesystem. It doesn't just conglomerate data at the very beginning or at the very end.
-EVAC
-
Why would you want to defrag a filesystem that does not require defragging?
Exactly what I was wondering.
Distribution: Gentoo
Kernel: 2.6.9-r9-gentoo
Processor: Intel Pentium 4 1.3Ghz
RAM: 256MB RAMBUS
HD Space: 300GB (60/80/160)
<beastmaster> eh yeah same here, used to use mandy lol
<beastmaster> yeah damn.. that was a waste of 2 years right there lol
-
Ext2fs defrag
* Download: ftp://ftp.uk.linux.org/pub/linux/sct/defrag/
* Author: Stephen C. Tweedie < sct at redhat.com >
* License: GPL
Defragments your ext2 filesystem. Needs updated for glib libraries.
-
I was trying to answer this question for a windows user who didn't believe me when I said there is no need to do it...
How much disk space do you have?
If I remember correctly, one way that was suggested for doing this was making another partition and simply copying the partition you want to "defrag" over to this new partition...
But like the others said, there's erally no need. The only link I have about it is in german, so I don't know if that'll help.
Oh- but if I remember correctly, it's not wise to let your partitions get over 95% full because then information will be split up over the blocks and you'll really be in trouble!
There might be fixes for this now- I don't know what the date on my info was...
Di mi se mai fu fatta alcuna cosa || Vivir con miedo, es como vivir a medias
If Linux doesn't have the solution, you have the wrong problem.
-- mdwatts, Grand Master, >> 40000 posts
RIP: August 25, 2004
***Funky stars and monkey bars***
-
Doesn't 'e2fsck -c /dev/hdxy' do some kind of defragmentation? Or does it only check the partition for bad blocks etc?
I thought it was the latter, but when you actually do it, it seems to me it does more than that (based on the output it gives).
I know ext3 is backwards compatible with ext2 etc etc, but couldn't running this ext2 defrag utility screw up your ext3 journal? Just a thought... after all, it probably doesn't expect a journal, and it might be confused by it.
-
ext3 get's "reindexed" everytime it is mounted, which can be considered a defrag.
Running an ext2 tool on ext3 that will modify the data will likely fail or (as you stated) mess up the journaling, thus the data.
You can always convert the ext3 to ext2 then run the ext2 tools and then convert back to ext3...it's really less work then it sounds
-
-
This thread should have been defragged.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|