PDA

View Full Version : Defrag and Cluster size



report_2
02-03-2002, 04:26 AM
http://www.winguides.com/forums/showflat.php?Cat=&Board=genwin&Number=36219&page=0&view=collapsed&sb=5&part=

There were questions of my ability to derag in 9 minutes and later wondered if the speed would be effected by the cluster size used on the particular PC.
I am using 4kb cluster size.
33GB on 2 Hard drives spread out over 5 partitions all using 4kb clusters.

Does anyone know if this could be a variable in defrag speed?

Mosaic1
02-03-2002, 04:48 AM
The smaller the cluster size, the greater the number of clusters. I don't know, but that's an excellent question. Is the speed determined by the number of files, the percentage of Fragmentation? Or the number of clusters on the drive. I think the first two would have more bearing. That's my surmise. I could be wrong.

samtyler
02-17-2002, 11:34 PM
IMHO it has more to do with the size of your temporary internetfiles folder when you defrag cuz that gets the most activity. and second with how much copying and deleting that you do between defrags. if you want a really fast defrag don't change the content of your hard drives.

Just talking of the top of my hed.
SamT

report_2
02-18-2002, 02:54 AM
The more I learn of this subject the more insteresting it gets.

I now understand that if I have the exact same amount of files and folders on a drive; comparing different cluster sizes I find that more fragmentation will occur with the smaller cluster size and I can only assume that the smaller cluster size would take longer due to the larger number of allocation units to defrag the same amount of fragmented files because the files would require a greater amount of allocation units.

The new question would be; Does defragger take twice as long to defrag an 8kb cluster than it takes to defrag a 4kb cluster? If so, then all is relative.

samtyler
02-19-2002, 09:22 PM
Your question:
Does defragger take twice as long to defrag an 8kb cluster than it takes to defrag a 4kb cluster?
In an ideal (Max-unideal) situation where no file had any contigous clusters

figure1 /images/forums/icons/wink.gif

<pre>file1cluster. file2cluster. file1cluster. file2cluster. file1cluster. file2cluster.</pre>

it would take twice as long to defrag a 4Kb FAT system.

Forgive me /images/forums/icons/blush.gif if I seem too simple for you, but I don't know what you know.

When you write the first file to a formatted HD it looks like this.

figure2

<pre> Key: A = one cluster of file 1
B = one cluster of file 2
C = Etc.
lower case = partially used cluster


AAAAAAAAAAAAAAAAAAAa

</pre>

Fragmentation = 0%, read speed = 100%, write speed = 100%

When you write more files to the HD it looks like

figure3
<pre>AAAaBBBBBBbCCcDDDDDDdEefghiJJJJjKKKKKKKKKKKKKKKkLL lMmNNNn
</pre>

Fragmentation = 0%, read speed = 100%, write speed = 100%


then you delete some files

figure4
<pre>AAAa CCcDDDDDDd fg KKKKKKKKKKKKKKKKkLLlMmNNNn
</pre>

File fragmentation = 0% and Free space fragmantation = 2% (I'm making up numbers /images/forums/icons/wink.gif ) read speed = 100%, write speed = depends on file size to be written.


then you write another file to HD

figure5
<pre>AAAaPPPPPPPPCCcDDDDDDdPfgPPPPPp KKKKKKKKKKKKKKKKkLLlMmNNNn
</pre>

File fragmentaion = 2% /images/forums/icons/frown.gif and Free space frag = 1%, read speed = 90%, write speed = depends

Now you defrag

figure6
<pre>AAAaPPPPPPPPPPPPPPPpCCcDDDDDDdKKKKKKKKKKKKKKKKkLLl MmNNNn
</pre>

Fragmentation = 0%, read speed = 100%, write speed = 100% /images/forums/icons/cool.gif

if you write to this defragged HD it will write after 'NNNn'

This situation occurs because when BIOS writes to the HD it starts at the beginning of the HD and looks for the first empty cluster and fills empty clusters in order.
if you never delete (Empty Recycle Bin, or hold the Shift key down when deleting) you will never have to defrag. /images/forums/icons/wink.gif /images/forums/icons/wink.gif /images/forums/icons/wink.gif

Cluster Size

Every file on the HD wastes 1/2 (average) of a cluster because only one file can occupy a cluster.
smaller clusters use space more efficiently. 1000 files at 8K clusters = 4Megs waste at 4K cluster only 2 Megs waste! /images/forums/icons/shocked.gif

SideBar
The C:\Windows\Favorites is full of tiny (80 to 200 bytes) files. If you are really hurting for HD space like with a 486, Win95, 1Gb Hd, 16Kb FAT, you can create a small 1Mb compressed drive and use TweakUI to move the location of the Favorites folder to this compressed drive. 1Mb compressed will hold about 10,000 internet shorcuts where 10,000 shortcuts uncompressed takes 160 Mb /images/forums/icons/shocked.gif /images/forums/icons/shocked.gif with a 16K FAT, or 80Mb with an 8K Fat, and at the best case, 40Mb with a 4K FAT.
I ran some numbers on my box and this is what I came up with:

<pre>
C: drive = 14,286 files @ 1,440,826,255 bytes (not counting Favorites or Swap File)
14,286 x 2Kb = waste
Waste = 28,914,864 bytes = 2%

Favorites = 282 files @ 63,598 bytes
282 x 4Kb = 1,155,072 bytes
1,155,072 - 63,598 = waste
Waste = 1,091,474 bytes = 94% /images/forums/icons/shocked.gif
</pre>


I hope this has given you some insight into HDs, FATs, and Defrag.

I Think!?
SamT

report_2
02-21-2002, 03:06 AM
I have been reading a lot on this subject and like your explanation for how
files are stored. In my reading I had seen a (pay for) tool that measured
wasted space called V Commander (I think).

I would like to have a free tool that does the same thing without all of the
other paid for features.

I used Find to locate files and folders that had a size less than 4kb and it
found 6995 of them x 4096=28,651,521 divide in half=14,325,760 wasted bytes
or 14mb.

I attempted to find how many files were greater than 5kb but it exceeds the reportable limit of 10,000.

It all started with reference to being able to defrag in 9 minutes with 4kb
clusters and the next quote is likely the explanation:

"if you never delete (Empty Recycle Bin, or hold the Shift key down when
deleting) you will never have to defrag. "

I almost never use the recycle bin.

Thanks for the valued input.

Mosaic1
02-21-2002, 04:00 AM
Do you ever uninstall a program? Clean out your Temps and temp internet folders? Ever scanreg / fix? If you perform a search for all files no more than 3 Kb you will get the same result. The number of files exceeds.................

samtyler
02-21-2002, 04:10 PM
As far as Defrag is concerned "wasted Space" will almost alway run about 2% on a large system. Defrag thinks that all files are equally important.

If space and speed are of a concern to you, first do a search for "*.bak" and send all of these to the Recycle Bin (perform a standard 'Delete' as opposed to holding down the 'Shift ' key while selecting 'Delete'.) Now 'Find' "*.txt, *.doc, *.wri" After looking at each result and deciding which ones have no interest to you, 'Delete' them.

Now 'Delete' everything in 'C:\Windows\Temp' and with IE/Tools, Shift&gt;Delete 'Temporary Internet Files.'

Run 'Scanreg/fix' and 'Regclean, verify that your OS is running ok and delete the regclean restore files. Empty the 'Recycle Bin'.

'Find' "*.log" and since this is the first time you have dealt with *.log files and since you have a lot of programs installed you will have to review each log to see if there is any registration or other kind of user authorization information in them and decide which ones to delete. If each log files has a different name (Name.log) you can move all of them to a new folder 'en masse' so that you can restore one of them in case a program changes so it is unusable.

Uninstall any programs you don't want or need.

Empty the Recycle Bin, turn off Virtual memory, reboot to Safe Mode and run defrag. Turn on Virtual Memory and reboot to normal mode.

This procedure should free up several hundred Megs and wil defrag VM and move it to the back of your HD.

DISCLAIMER: I take no resposibility for ANYthing that happens to your computer if you follow any of these tips. Perform at YOUR OWN RISK!!!

I usually do all of this when I am setting up a system except that I alway do the VM thing and defrag in Safe Mode. I don't usually delete the text and doc files after the system is setup completely.

I think?!
SamT

jdharm
02-21-2002, 07:26 PM
I haven't tried it, just read that its only purpose was to calculate wasted space and saved space if you convert cluster sizes. Its called <a target="_blank" href=http://ftp://ftp.euro.net/d5/simtelnet/win95/diskutl/waste95a.zip>Waste</a>. Shareware.

Josh

"If I only had a little humility, I'd be perfect."

Mosaic1
02-21-2002, 09:04 PM
My original post:Is the speed determined by the number of files, the percentage of Fragmentation? Or the number of clusters on the drive. I think the first two would have more bearing. That's my surmise

samtyler,
I am not arguing with you. I do feel the need to point out some realities however. I have several partitions. I have the OS on C:\ My docs and favs on E. The most frequently used partition is optimized as best I can manage without making it my life's work. My Programs are installed to D not to C:\program files unless a program demands installation there.

Fragmentation is a part of using a computer. I want to be able to use it without having Fragmentation uppermost in my mind. Everytime I create or delete, I add remove programs, I increase fragmentation. I use my computer. It is perfectly normal. Use the recycle bin. Please. This is a safety measure. Let's not advise people to stop using the Recycle Bin.

Divide any number by any other number and you are likely to have a remainder. Yes, with fewer files ( or larger files vs smaller ) there will be fewer remainders. I agree, if you do have a large file in a highly fragmented drive going into 4k clusters, this is going to result in more fragmentation. That large file will occupy many more clusters than if it were going into a drive with a 16k cluster in either case. But the larger the clusters, the fewer clusters it will occupy and therefore, the lower the fragmentation for that particular file. The size and number of the files on your computer is a factor as well.
I have a 4k here and another over there and one more way over there etc. I think disk Maintenance is key here. You are always going to have fragmentation. Let's discuss another side of this debate.

When you have smaller clusters the end result is less wasted space. a 3k file in a 4k cluster (or a remainder of 3 k after the division of a larger file ) yields 1k unused space. If you have 8, 16, or 32k clusters the waste will be 5,13,and 29k respectively.

This is the kind of debate with many sides to the argument. Fragmentation versus the efficient use of Hard Drive Space. Disk Maintenance is always an issue. I agree that deleting files before you do a defrag is essential. This sums it up for me. Clean it out and then organize it.

The number and size of the clusters and files along with the way a computer is used determines the amount of fragmentation. Allowing the drive to become highly fragmented will increase defrag time. It's about balance.

samtyler
02-21-2002, 11:17 PM
Mosaic1
I agree with you re disk maintenance and when to empty recycle bin wholeheartedly. I too have multiple HDs and partitions. and I only empty the RB just before a defrag. (I want to keep those files 'just-in-case')

report_2 said that he? hardly ever uses the RB and I did preface that last post with "If space and speed are of a concern to you." I was trying to give report_2 a sense of what is involved in a major tuneup defrag.

I defrag about every 2 or 3 months unless I start to have a string of freezes or fatal errors. I have found that after the first few defrags which will put the most used system files in good shape there just isn't enough difference to warrant (for me) defragging more often.

Mosaic1, I have read several of your posts and have a lot of respect for your knowledge and I am a newbie here and I hope that I am not stepping an anybody's toes.

I think?!
SamT

Mosaic1
02-22-2002, 05:33 AM
samtyler,
No toes aching here. You are very knowledgeable. I wanted to give a broader perspective and actually do agree with a lot of what you said and argued your point as well. I look at things from a broader perspective though.

Defrag is important. A question like the one asked here is an exercise. But in fact, a faster defrag is for our convenience. Is it a better defrag? What elements come into play. All that were mentioned. I think though that it really depends on the condition of the Drive and the types of files etc.
To tell you the truth, I apologize if I sounded impatient. I generally avoid these types of posts. There are variables and all points of view are valid. Too much typing. I think we do agree over all on how it's done. I just lean toward smaller clusters as a preference.


Mo

report_2
02-22-2002, 06:35 PM
This subject has transcended several posts and has been a good exercise for my knowledge base.

I have a good, fast and efficient machine as a result of maintenance and good tweaks extrapulated from these forum boards.

I too have two HD with ample available space. I use the 4k clusters and can defrag using WinME defrag in 9 minutes doing it weekly. This amount of time is apparently pretty fast. It used to take 45 minutes and it was a chore that I would do monthly instead of weekly.

I did do a Find files and folders for items &lt;4k and it revealed 6995 or so vs exceeding the 10,000 k limit.

To get back to the begining of this particular thread...I do believe the answer is, for example, a 7gb HD with 4k clusters will have more allocation units to defrag than one with 16k clusters and thereby defrag faster with the 16k clusters.

I am glad to have been part of this dialog.
Thanks,
Bryan

report_2
02-28-2002, 01:01 AM
Today I realized that I already had a freebie on my PC and until now I did not know what it's use was:

Karen's Disk Slack Checker amongst her many good tools.

http://www.karenware.com/powertools/ptslack.asp