Jump to content

Why does Linux NOT fragment??


qeldroma
 Share

Recommended Posts

me:

..?

If i put several files on a limited space and change that files a lot, why doesn't something fragment by the time??

Especially when, let us say, 95% of space is used??

--------------------------------------------

DOlson:

<wwe attitude>

Because it's that damn good.

</wwe attitude>

--------------------------------------------

Mystified:

Maybe this will help - http://www.mandrakeuser.org/mub/viewtopic....c=10660&forum=7

And I agree with DOlson!!

--------------------------------------------

me:

Shame on me, i never will be in doubt again about Linux..

...but, i read the older MUO-post and couldn't get BEHIND the way, the filesystem PREVENTS this problem.

Does anybody know a link where i can get DEEPER infos, about the NOT fragmenting filesystems (Reiser/ext2/ext3)?

--------------------------------------------

Mystified:

http://www.linuxgazette.com/issue55/florido.html

I hope this helps!

--------------------------------------------

arusabal:

Mystified hat folgendes geschrieben::

++++++++

http://www.linuxgazette.com/issue55/florido.html

I hope this helps!

++++++++

Great link!!

--------------------------------------------

Mystified:

Thanks Arusabal. I actually found it on the old MUB board. There's so much good information on that board and I still go back to it and search when I'm looking for answers. It's my understanding that it will be taken down at some point which will be a real shame.

--------------------------------------------

Bluebeard:

Everyone running Mandrake (or any other Linux for that matter) should regard as mandatory reading the Large Disk How-To, the How-To: Multidisk Tuning, the Hard Disk Upgrade Mini How-To, the mini Partition How-To, the mini Partition Rescue How-To and the Filesystems How-To. If you use ext3, you can add the Ext3 File System Mini How-To. For those aspiring to guruhood, there is the "Design and Implementation of the Second Extended File System" at http://e2fsprogs.sourceforge.net/ext2intro.html, the paper "Analysis of the Second Extended File System" by Louis-Domenique Dubeau at http://www.nondot.org/sabre/os/files/FileS...Systems/ext2fs/. This paper was for me the best explanation of the structure and is only mildy technical. Finally there is Ext2fs Undeletion of Directory Structures mini-How-To and the Linux Ext2fs Undeletion mini-How-To. For journal file systems there is the link already posted to Linux Gazette, http://www.linuxgazette.com/issue55/florido.html and the excellent 11 part series by Daniel Robbins of Gentoo starting at http://www-106.ibm.com/developerworks/libr...brary/l-fs.html.

Happy Summer Reading.

--------------------------------------------

SuGa:

and if you use reiser you could get probs with such a high partition-usage. the filesystem is then afaik not stable anymore

--------------------------------------------

ramfree17:

++++++++

Mystified hat folgendes geschrieben::

Thanks Arusabal. I actually found it on the old MUB board. There's so much good information on that board and I still go back to it and search when I'm looking for answers. It's my understanding that it will be taken down at some point which will be a real shame.

++++++++

when you do some searching and found some great gems, why dont you re-post the info here and give credit to the original poster. that way we can minimize the loss of info.

--------------------------------------------

Glitz:

++++++++

qeldroma hat folgendes geschrieben::

..?

If i put several files on a limited space and change that files a lot, why doesn't something fragment by the time??

Especially when, let us say, 95% of space is used??

++++++++

The short answer, it does get fragmented unless you do housekeeping. My /home partition (ext2 filesystem) is 12% fragmented according to fsck. That amount of fragmentation on my windows partition would have set off Norton System Doctor long ago Wink

I don't have a clue on how to fix it. Note that /usr is only 0.1% fragmented (probably since nothing ever gets written to it).

--------------------------------------------

Mystified:

The poster was rsd. Here's the link http://www.mandrakeuser.org/mub/viewtopic....ic=7578&forum=7

Bluebeard, you might want to check those links. You have commas and periods after them so they don't work until you remove them manually. Just wanted to let you know. Now my question is can you provide cliff notes for all that info?

--------------------------------------------

illogic-al:

Just wondering how much space it woulg take up on my hard drive if I were to wget the old forum.

--------------------------------------------

Bluebeard:

To Mystified: Thanks for the info. I guess I'm to accustomed to Usenet. As far as Cliff Notes, we should explain to users outside N.A. that these are precis booklets used by students as support for summarizing school course content, particularly when you didn't make proper notes yourself. In Canada, they are called Cole's Notes. Me? Compress all that? I'll think about it.

For a long time.

--------------------------------------------

Mystified:

Well you thinking about it for a long time beats me reading it for a long time! Laughing All I want to know is that it works. I'll let somebody smarter than me figure out why.

--------------------------------------------

ramfree17:

illogic-al hat folgendes geschrieben::

++++++++

Just wondering how much space it woulg take up on my hard drive if I were to wget the old forum.

++++++++

talk to tross about it. he already did something like that...

--------------------------------------------

tymehacker:

qeldroma hat folgendes geschrieben::

++++++++

My /home partition (ext2 filesystem) is 12% fragmented according to fsck. That amount of fragmentation on my windows partition would have set off Norton System Doctor long ago Wink

++++++++

But, how long have you been running your Linux box w/o reformatting the system?

In, oh, a month or less, my windows partitions can become up to 35%+ fragmented. And thats just my small first partition that has nothing but system files on it. I install everything on my second partition, and keep all my files there....

p.s.-I hate norton system doctor. damn thing is too annoying

--------------------------------------------

Glitz:

The last time I installed linux (reformatted the linux partitions) was November 2001 when I bought LM8.1. (By the way, it is now up to 16% fragmented). I do a lot of downloading of source files, mpegs, pdf files, and text documents to my /home partition so it's little wonder that it gets fragmented quickly. Fragmentation of memory or harddrive space is a physical (as opposed to a logical) phenomemon that really has little to do with the filesystem used. You can try to minimize it by using up the larger free spaces on the disk first before resorting to filling in the little gaps but in the end it will happen and it only gets worse without housekeeping.

I like Norton system doctor. It is very useful for defragmenting the disks and keeping the registry clean. I've managed to keep win98 running smoothly for almost 2.5 years without a re-install using it. Mind you, disks and registry is all I use it for. Everything else is turned off to keep it from being annoying. In fact, the only reason I had to re-install it was because LM7.2 hosed my whole system during installation. It was actually my fault. I have an unusual ordering of my hard drives in bios (I boot from scsi not my ide drive) and this tends to confuse linux as to what partition is really what partition. Note to self: Never use the automatic installation from configuration file. Wink

PS. The smaller a partition is and the more files get written and deleted from it, the faster it will get fragmented percentage wise. Also, if you have your windows temp directory in that small partition, it's little wonder that it fragments fast. The installation of a single average size program will cause the creation and deletion of hundreds or even thousands of temporary files. If any permanent system files are installed while these temporary files are in existance then they will most likely be fragmented.

--------------------------------------------

tymehacker:

Temp and PageFile are both moved over to my secondary drive. I still think Windows just does a horrid job of watching after itself...could be wrong. As for norton, I do use it's registry cleaner and what not...when I was talking about Norton System Docter I was actually thinking of Norton System Monitor...i think thats what it's called...i always turn it off.

Link to comment
Share on other sites

I don't know why they don't fragment. Reiserfs has a web site that might provide that info. I do know why FAT32 fragments. A real general answer (which I don't think you will be satisfied with) is the design of the file system.

 

E.g.

 

Fat32 has catalog sectors in the begining of the partition. Each file entry has a pointer to the first sector which has a pointer to the next sector so on.. It also has a list of available free space. It's a primitive file system compared to more recent file systems. Request for free space scans that file allocation table (FAT) and locates the first available block of space that is large enough.

 

File 1: 500 meg

File 2: 500 Meg

 

Delete File 1

 

Free: 500 Meg

File2: 500 Meg

 

Create File 1: 200 meg

 

File1: 200 meg

Free: 300 Meg

File2: 400 Meg

 

Create File3: 100 Meg

 

File1: 200 meg

File3: 100 meg

Free: 200 Meg

File2: 400 Meg

 

Delete File1

 

Free: 200 meg

File3: 100 meg

Free: 200 Meg

File2: 400 Meg

 

That's fragmentation.

 

Perhaps file systems that don't frag have behind the scene shifting of files. This is possible, especially in a multi-thread OS.

 

This is guessing though because I haven't done my research :P

Link to comment
Share on other sites

I got a REALLY good documentation about binary-tree-filesystems.

 

And that's exactly the answer...

 

The whole Harddisk is a big collection of leaves, which are linked or not...

 

If i have understood this right, following is the way it works:

 

A file is generated:

A "branch" is generated, which points to a leave. This leave isn't big enough for the file, so it pints to the next leave at the end......ando do on....

The leaves have got a flag, beeing free or not. When a leave/branch is searching a free leave, it starts at the first leave till a free flag is found....and so on...

 

So the fixed leave size is the reason, combined with the interlinkage...

 

And then there are a lot of mathematical optimizations, to make the free-leave-search fast 8)

Link to comment
Share on other sites

...an easy to understandable picture is a pyramid of glasses, where you put water in from the to...

 

The water always wents down to the next free glass. And if some glasses are emptied again, they will be filled up again, when something is put in from top again...

Link to comment
Share on other sites

I understand the allocation issue. Meaning you won't run out of file space as long as you have free sectors. Mac OS does the same thing. However, in terms of speed, I wonder what kind of optimizing they do. If you have a 500 meg file that is split all over, its going to take longer to read that file. If you have all the sectors together, it reads it quick (like to state the obvious *grin* ) . Wonder what those file systems do to prevent that..

Link to comment
Share on other sites

Check out comparizations between the different journalling filesystems.

Some of them work well with big files, some better with smaller ones and that is exactly what i mean, they have different binarytree-models on which they are based...

 

Sorry, got no link in backhand, but a google will do fine, i think

Link to comment
Share on other sites

...an easy to understandable picture is a pyramid of glasses, where you put water in from the to...

 

The water always wents down to the next free glass. And if some glasses are emptied again, they will be filled up again, when something is put in from top again...

 

This is what causes fragmentation. If part of a file is in one glass and part in another glass. That means they are on non-contiguous parts of the harddrive (the definition of fragmentation).

 

Glitz.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...