[G4] defraging a Mac (the 85% rule)

Brian Silverio bsilverio at necc.mass.edu
Mon Apr 5 07:15:11 PDT 2004


Quoting "Wilkin, Wayne (Mass)" <Wayne.Wilkin at Staples.com>:

> I am probably going to hammered for this one but here goes. Besides
> fragmentation there has also been a general consensus to always keep at
> least 15% of your hard drive un-used. What does this have to do with
> fragmentation. Ok so I can't remember were I read it but I did. Think it
> was
> Macfixit. But when a system writes to the hard drives directory the
> directory needs to use continous disk space. The directory cannot be
> fragmented. If a hard drive is so full that when rewriting directory
> information it (the directory) can become corrupt. I look forward to others
> views on this, Wayne.
> 

For an analogy consider your refrigerator when you have the entire family coming
over for dinner.  If the fridge is empty it is easy to find places to put the
food.  You can even arrange it in some sequence.  But when the fridge is full it
becomes difficult.  You have to move things around.  There may not be space for
everything and so on.  (Watch how I get hammered for the analogy ;)

When you need space for a file the first choice is for contigious space.  If a
block of space is available large enough for the file that space is used.  If
you have a 200MB file and a 201MB space is used there is 1MB left over.  As your
drive fills up, it is POSSIBLE, that you will end up with many small chunks of
space.  So when you go to save another 200MB file the only space available is
200 chunks of 1MB each.  This is what is meant by fragmentation.
Please note that it is very unlikely that a 200MB file will be split into 200
pieces.  The point is that it is now in several pieces and each time you load
the file the time to load is increased.  

A disk access is split into five parts.  
1. The "path length" or amount of code traversed in the OS to perform the read.
2. The queue wait time
3. The time it takes to move the heads (seek) to the correct cylinder
4. The time it takes for the first sector to spin under the head
5. the time it takes for the data to be read

So for every physical segment of file, steps 1, 2, 3, and 4 are repeated.  Step
5 remains essentually the same.  If the file was split into 200 pieces you would
notice the difference.

This explanation is simplified for clarity.


Brian Silverio


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the G4 mailing list