-   Linux - Software (
-   -   defragmenting (

ttilt 12-27-2003 03:00 PM

I searched for defradmentation options on Linux, but only found one post on that topic and people said it's not necessary to defragment the disk on linux. So I was just wodering if that's really the case. How can Linux not need to be defragmented? And how can one defragment the HD on linux?


Great site this, I just found it yesterday!

trickykid 12-27-2003 03:14 PM

Like the post you found stated, no need to defrag your drive in linux. I'm suprised it only turned up one post for you, this is asked all the time.


merlin371 12-27-2003 03:35 PM

but why do you not need it?

trickykid 12-27-2003 03:39 PM


Originally posted by merlin371
but why do you not need it?
You only defrag a filesystem when its fragmented, which in Linux you don't need to, cause it doesn't get fragmented. Its the way they designed the filesystem, which is superior to Windows type filesystems.

Try searching, there are better explanations out there already on this topic.

Mega Man X 12-27-2003 05:39 PM

Roughly saying, it's because the file systems are a conjunct of blocks of the same size. Files are allocated into those blocks, but the files are not of the same size of the blocks. This will generate a lot of blocks with wasted/empty space.

Linux, in another hand, tries to preallocate data in blocks of 8 units (ext2 and 3, no idea about the other file systems for Linux...). If a file is not in use or deleted, it reallocate the block, so no space is wasted.

That's why in Windows (FAT16/32, I have no idea how NTFS works...) you lose a huge amount of space after a while with half-used blocks. This is bad for performance as well, since it takes longer time to the OS access these blocks. Running a defrag fix it though, it frees space, make the system faster and so on...

I've heard of some tools to defrag Linux partitions, never tried any of them either (looks tough to use, cannot be used under mounted partitions and so on). It's not a matter that you don't need to defrag a Linux partition, actually, you could do, but the waste of space in blocks is to small to worry about it...

Again, I have no idea how NTFS works, but I'd like to know :)

dalek 12-27-2003 06:51 PM

Actually there is a company that is making software to defrag Linux. They "claim" it does get defraged. I have never seen mine get over about 3 or 4% myself. I delete and copy crap all over the place. Usually because I screw something up. :scratch:

If you really feel you need it I may can search and find the company name. I sent them a e-mail. Still think they are milking a dead cow myself. :p

My advice, unless you are running some big fancy server that you need every ounce of speed from, don't worry about it.


:D :D :D :D

Last time checked, .3% on this rig. Note the ".".

ugenn 12-28-2003 01:37 AM

i have an ext2 partition that is 6.8% defragmented.

mikshaw 12-28-2003 02:08 AM

Someone please correct me if I'm wrong, but I believe Linux file systems actually do they came out with journal file systems (ext3 and reiser).
I may be mistaken about this, but i assumed these were, in a sense, self-defragging file systems. Ext2 is not.

ugenn 12-28-2003 02:14 AM

no. journaling is more concerned with fs recovery than defragmentation.

mikshaw 12-28-2003 02:20 AM

k...I wasn't sure....hence the "correct me" part.

dalek 12-28-2003 07:46 AM

I must confess, I use reiserfs for all my partitions. That may make a difference.

I seem to recall reading somewhere that you have to be pretty fraged to really make a noticable difference.

How do you get it to check that anyway? I watch it when I boot up, which ain't very often, and it scrolls by.


:scratch: :confused: :D :D :D

OrphanedLand 12-28-2003 08:34 AM

Linux file systems can be fragmented. It's normal. Because Linux is multi-threaded and multi-user OS. And fragmented file system is good for these OSes. To defragment Linux can decrase performance.

Sometimes you can see your HDD is spinning so much. In that time, Linux changes inodes for files and reallocate some files for increasing performance. But it is not defragmantion.

Linux is a good designed OS. So don't worry about it. Only use ;)

Linux forever

All times are GMT -5. The time now is 08:44 PM.