PDA

View Full Version : Fragmentation Tips and Myth



Master Razor
09.11.12, 18:48
What is Fragmentation?
Example: we have a file that we save on a disk. Every time we edit that file, the sizes increases or decreases. The data from it must be stored somewhere on the disk. If the disk is empty and no other data has been written to it, then the file will be saved as a contiguous file. Otherwise it will be saved in the next free space it finds available. The process is called fragmentation.

Performance and Life?
The HDD uses a magnetic arm called an actuator that reads the contents of the disk. The movement is done by a very powerful magnet that helps move the arm by switching polarities.
Now, based on this, movement is critical. If the HDD is fragmented it will cause the arm to move back and forth many times in order to open a file. The file in this case does not matter; whether it is a huge file (like a video file) or a small file (document), the time required for reading it is increased.

Whether or not a defragmenter is used, the same can be achieved without it by simply performing a format thus making all space contiguous.

Defragmenter steps are:

directory consolidation
file consolidation


Manual defrag:

move all files from the partition/drive
format the empty drive
perform a restart*
recreate the directorial structure
copy all files back to their original dirs


Why directories first?
The first HDD category must be the rarest to be changed.
The order is: less frequent --> middle --> high frequent

Basically the files you work with should the last to enter the disk.
This is why windows boot loader is always copied first on install or has it's own partition (as wee see in vista, 7 and 8).

* The restart is necessery to reset the HDD next-free-space pointer. For example: you defragment a drive but the HDD will save the file where it was left off (most likely in the middle of the disk) even though the disk was already defragmented. Only a restart will reset the pointer.

Defragmenters
Choose them wisely. Don' be like 'ooh it hs pretty colors and is made by a big shot corporation. it mut be good!'. Wrong: the best defragmenter is one the performes the above steps. It must create categories and with gaps between them for use as an extended space in order to overcome fragmentation.

Defragging frequency
Contrary to popular belief, you shouldn't defragment more than once every few months. The disk overhead generated by a defrag will shorten the disk's life by wearing it out and the performance gained will not be noticeable.
A manual defrag would be best if you are defragmenting a drive filled with data (videos/documents/music etc.). It is faster and more efficient than a defrag. Also causes less overhead.

yoco
09.11.12, 23:37
So which defragmenter would you recommend?

system28
10.11.12, 10:21
I prefer UltimateDefrag

DiskTrix (http://www.disktrix.com/)

Master Razor
10.11.12, 13:02
I prefer UltimateDefrag

DiskTrix (http://www.disktrix.com/)

This is not a debate.
I opened this tutorial to guide you in choosing your defragmenter. I wrote how IT SHOULD perform its defrag procedure.

I use a lot of USB sticks for booting off live iso's. What if I tell you no defragmenter was able to defragment large iso's successfully off that drive? Spaces was plenty but all defragmenters left 1 fragment. While 1 is acceptable for windows but for loading a live CD, it gives an error that is not contiguous.

anon
10.11.12, 16:59
I use a lot of USB sticks for booting off live iso's. What if I tell you no defragmenter was able to defragment large iso's successfully off that drive? Spaces was plenty but all defragmenters left 1 fragment. While 1 is acceptable for windows but for loading a live CD, it gives an error that is not contiguous.

I thought defragging was only harmful for flash drives, as they don't have mechanical components slowing down the seek time for fragmented files, but do lose read-write cycles in the process.

Master Razor
10.11.12, 17:11
I thought defragging was only harmful for flash drives, as they don't have mechanical components slowing down the seek time for fragmented files, but do lose read-write cycles in the process.

You don't understand. Bootloader can boot any .iso image on the stick but in order for it to that, the .iso images must be contiguous. I use manual defragmentation on my drive: format and re-copy. This is less harmful than a defragmenter and I only defrag it when there are fragments (I use an exec that analyzes each file and states the fragments).

You should never defragment your USb sticks or external drives unless you do what I do.

anon
10.11.12, 18:20
Gotcha.

Was this (http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx) among the ones you tried?

Master Razor
10.11.12, 19:21
That is what I use to test the files. I have never used it as a defragmenter.
I sustain my original statement: a manual defrag is the only thing that comes close to 100% without fragments.
I have windows installed for two years and only did one defrag. Top notch even today.

Instab
11.11.12, 02:46
Contrary to popular belief, you shouldn't defragment more than once every few months.
there is no rule of thumb. it depends on the usage.
if you don't have much traffic then larger gaps between defrag runs are no problem. but if you have a lot of new files and deletions regularly defragging more often helps.
also in my exprience defragging plays no noticeable role in the disk's lifespan. even more so since people rarely use disks until they die but buy new ones much sooner.


I have windows installed for two years and only did one defrag. Top notch even today.
right after the installation the system disk or partition is seriously fragmented already. just run an analyzer and have fun with all the red areas. not much imagination needed to picture how it's gonna look after 2 years of average use.

Config
11.11.12, 10:33
I have given up defrag disk for years now. I observed no benefit from it even in those old slow hardware days.

Master Razor
11.11.12, 13:29
also in my exprience defragging plays no noticeable role in the disk's lifespan
Everything plays a noticeable role. Defagmenting is an intense disk operation. It's not like you shift files around each day from one end of the platter to another.
You may not of noticed it but it does wear it out.

I usually open my CMD and type in a command that analyzes the remaining contiguous space on the drive. So, if there is more than 90% of there's no need to defragment.
This is the same procedure that Microsoft's internal defragmenter checks if the drive needs a defrag or not.


but if you have a lot of new files and deletions regularly defragging more often helps.
Correct. This is what I've been saying all along. A user that doesn't update the OS, doesn't install new stuff and only plays a game once in a while or browses the net does not need to defrag often.


right after the installation the system disk or partition is seriously fragmented already. just run an analyzer and have fun with all the red areas. not much imagination needed to picture how it's gonna look after 2 years of average use.
It's against logic. Windows install copies the DVD temporarily on the disk. This is 2.6GB placed at the start of the disk. Windows then extracts the data to their permanent folders. These are placed as contiguous from the offset of those 2.6GB. Upon finishing it only removes that 2.6GB temp files. Conclusion beeing that we remain with a 2.6GB gap in the begging of the disk.
Setup doesn't create new files from I know as they already exist. All it does is set the default options in the registry and create indexes and stuff.

Instab
12.11.12, 05:49
You may not of noticed it but it dös wear it out.
exactly that's why i wrote "no noticeable role".


It's against logic.
but trü :P just give it a try in doubt. same gös for hfs+ (osx) as well btw

svartevarg
13.11.12, 16:21
Disktrix and O&O Defrag 16 are the best defragmenters i tried that are lightweight (you can use your computer without lags while they are defrag your hdd)....

saebrtooth
14.11.12, 10:55
For my usuage anyway, defragging is essential to maintain performance

I have found that supercache speeds up the defrag process. But dont cache the boot drive when defragging with Diskeeper as it will corrupt your boot drive drive
However SuperCache and Auslogics Disk Defrag does play nicely